MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / jsonError

Function jsonError

src/http-errors.ts:1–3  ·  view source on GitHub ↗
(c: any, status: number, code: string, detail: string)

Source from the content-addressed store, hash-verified

1export function jsonError(c: any, status: number, code: string, detail: string): Response {
2 return c.json({ error: code, detail }, status);
3}
4
5export function jsonErrorResponse(status: number, code: string, detail: string): Response {
6 return new Response(JSON.stringify({ error: code, detail }), {

Callers 2

http.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected