MCPcopy Create free account
hub / github.com/cloudflare/computer / errorJSON

Function errorJSON

examples/assets/src/index.ts:179–185  ·  view source on GitHub ↗
(error: unknown, status: number)

Source from the content-addressed store, hash-verified

177}
178
179function errorJSON(error: unknown, status: number): Response {
180 const message = error instanceof Error ? error.message : String(error);
181 return new Response(JSON.stringify({ error: message }), {
182 status,
183 headers: { "content-type": "application/json" },
184 });
185}
186
187// Decode a base64 string to bytes. atob is available in the Workers
188// runtime; map each character to its byte value.

Callers 1

handlePromptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected