/** * Typed errors thrown by REST handlers. * * Each error carries a stable `code` that the relay envelope dispatcher * (Batch 3) maps to a wire-level status. Until then, the handlers throw * and the relay loop just acks — Batch 3 will catch and translate. * * Why typed errors instead of returning `{ ok: false, code }` discriminated * unions? Two reasons: * - The handlers are also called directly from unit tests; `throw` lets * tests use `expect(...).rejects.toThrow(NotFoundError)` ergonomically. * - The Batch 3 dispatcher needs a single `try/catch` boundary; a sum * type per handler would force every handler to return its own variant. */ export type HandlerErrorCode = "BAD_REQUEST" | "NOT_FOUND"; export declare class HandlerError extends Error { readonly code: HandlerErrorCode; constructor(code: HandlerErrorCode, message: string); } export declare class BadRequestError extends HandlerError { constructor(message: string); } export declare class NotFoundError extends HandlerError { constructor(message: string); } //# sourceMappingURL=errors.d.ts.map