/** * Typed errors thrown by REST handlers. * * Each error carries a stable `code` that the relay REST loop * (`cli-node/src/relay/rest.ts`) catches and maps to a wire-level status * (400/404/409/500) in the `rest_response` envelope. * * 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 relay REST loop 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" | "CONFLICT"; 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); } export declare class ConflictError extends HandlerError { constructor(message: string); } //# sourceMappingURL=errors.d.ts.map