MCPcopy Create free account
hub / github.com/TanStack/ai / jsonError

Function jsonError

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

Source from the content-addressed store, hash-verified

126)
127
128function jsonError(status: number, error: string): Response {
129 return new Response(JSON.stringify({ error }), {
130 status,
131 headers: { 'content-type': 'application/json' },
132 })
133}
134
135/**
136 * 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