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 * already canonicalised in the response (ApiError.toResponse).
50 */
51const safeMessageFor = (code: string, error: unknown): string => {
52 const framework = FRAMEWORK_SAFE_MESSAGES[code];
53
54 if (framework !== undefined) {
55 return framework;
56 }
57
58 return getErrorMessage(error);
59};
60
61const isClientErrorCode = (code: string): boolean =>
62 code === ElysiaErrorCodes.NOT_FOUND ||

Callers 1

errorHandlerFunction · 0.85

Calls 1

getErrorMessageFunction · 0.90

Tested by

no test coverage detected