MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / safeMessageFor

Function safeMessageFor

apps/api/src/middleware/error-handler.ts:51–59  ·  view source on GitHub ↗
(code: string, error: unknown)

Source from the content-addressed store, hash-verified

49
50 return framework ?? getErrorMessage(error);
51};
52
53const isFrameworkCode = (code: string): boolean =>
54 FRAMEWORK_SAFE_MESSAGES[code] !== undefined;
55
56/*
57 * The stack is developer detail for everything else. For framework
58 * VALIDATION/PARSE errors it embeds the submitted body, so it is never
59 * attached, in development or anywhere else.
60 */
61export const stackFor = (
62 code: string,

Callers 1

errorHandlerFunction · 0.85

Calls 1

getErrorMessageFunction · 0.90

Tested by

no test coverage detected