/** * Server Error Response Mapping * * Purpose: * - Convert runtime/server errors into stable, user-meaningful HTTP responses. * * Features: * - Specific mappings for oversized request payloads and invalid JSON bodies. * - Readonly SQLite detection with actionable error messaging. * - Safe fallback for unknown internal errors. * * Implementation Notes: * - JSON parse mapping is intentionally strict to body-parser parse errors only, * so unrelated `SyntaxError`s in route logic are not mislabeled as request-body issues. * * Changes: * - 2026-02-26: Tightened invalid JSON detection to avoid misclassifying generic runtime SyntaxErrors. * - 2026-02-26: Initial extraction from `server/index.ts` for reusable, testable global error mapping. */ export type ErrorResponsePayload = { error: string; code: string; }; export declare function getErrorResponse(error: unknown): { status: number; payload: ErrorResponsePayload; };