MCPcopy Index your code
hub / github.com/TanStack/ai / jsonError

Function jsonError

examples/sandbox-cloudflare/src/routes/api.run.ts:122–127  ·  view source on GitHub ↗
(status: number, error: string)

Source from the content-addressed store, hash-verified

120)
121
122function jsonError(status: number, error: string): Response {
123 return new Response(JSON.stringify({ error }), {
124 status,
125 headers: { 'content-type': 'application/json' },
126 })
127}
128
129/**
130 * Request middleware: parse + validate the body once and hand the typed result

Callers 1

api.run.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected