MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toErrorServerResponse

Function toErrorServerResponse

apps/cloud/src/api/error-response.ts:61–68  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

59};
60
61export const toErrorServerResponse = (error: unknown): HttpServerResponse.HttpServerResponse => {
62 const mapped = toHttpResponseError(error);
63 if (mapped.status >= 500) captureCause(mapped);
64 return HttpServerResponse.jsonUnsafe(
65 { error: mapped.message, code: mapped.code },
66 { status: mapped.status },
67 );
68};
69
70export const toErrorServerResponseEffect = (
71 error: unknown,

Callers

nothing calls this directly

Calls 2

captureCauseFunction · 0.90
toHttpResponseErrorFunction · 0.85

Tested by

no test coverage detected