MCPcopy Index your code
hub / github.com/callstack/agent-device / sendRestJsonError

Function sendRestJsonError

src/daemon/http-errors.ts:19–23  ·  view source on GitHub ↗
(res: http.ServerResponse, normalized: NormalizedHttpError)

Source from the content-addressed store, hash-verified

17}
18
19export function sendRestJsonError(res: http.ServerResponse, normalized: NormalizedHttpError): void {
20 res.statusCode = statusCodeForNormalizedError(normalized.code);
21 res.setHeader('content-type', 'application/json');
22 res.end(JSON.stringify({ ok: false, error: normalized.message, code: normalized.code }));
23}

Callers 7

handleArtifactDownloadFunction · 0.90
handleArtifactInventoryFunction · 0.90
handleUploadFunction · 0.90
handleUploadPreflightFunction · 0.90
handleResumableUploadFunction · 0.90
handleUploadFinalizeFunction · 0.90

Calls 1

Tested by

no test coverage detected