(stateHash: string, state: State)
| 24 | |
| 25 | export class RangeError extends Response { |
| 26 | constructor(stateHash: string, state: State) { |
| 27 | super( |
| 28 | JSON.stringify({ |
| 29 | errors: [ |
| 30 | { |
| 31 | code: "RANGE_ERROR", |
| 32 | message: `stateHash ${stateHash} does not match state (upload id: ${state.registryUploadId})`, |
| 33 | detail: { |
| 34 | ...state, |
| 35 | string: stateHash, |
| 36 | }, |
| 37 | }, |
| 38 | ], |
| 39 | }), |
| 40 | { |
| 41 | status: 416, |
| 42 | headers: { |
| 43 | "Location": `/v2/${state.name}/blobs/uploads/${state.registryUploadId}?_stateHash=${stateHash}`, |
| 44 | "Range": `0-${state.byteRange - 1}`, |
| 45 | "Docker-Upload-UUID": state.registryUploadId, |
| 46 | }, |
| 47 | }, |
| 48 | ); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | export class InternalError extends Response { |
nothing calls this directly
no outgoing calls
no test coverage detected