MCPcopy Create free account
hub / github.com/cloudflare/serverless-registry / constructor

Method constructor

src/errors.ts:26–49  ·  view source on GitHub ↗
(stateHash: string, state: State)

Source from the content-addressed store, hash-verified

24
25export 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
52export class InternalError extends Response {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected