/** * Typed error hierarchy for API Gateway responses. * Each subclass maps to an HTTP status and a machine-readable code. * Use toLambdaResponse() for the API Gateway Lambda proxy format. */ export declare abstract class AppError extends Error { abstract readonly code: string; abstract readonly statusCode: number; /** Formats this error as an API Gateway Lambda proxy response. */ toLambdaResponse(): { statusCode: number; headers: { "Content-Type": string; }; body: string; }; } /** Missing, expired, or invalid authentication token. */ export declare class UnauthorizedError extends AppError { readonly code = "UNAUTHORIZED"; readonly statusCode = 401; constructor(message?: string); } /** Rate limit exceeded. Carries the retryAfter delay in seconds. */ export declare class ThrottledError extends AppError { readonly code = "THROTTLED"; readonly statusCode = 429; readonly retryAfter: number; constructor(retryAfter: number, message?: string); toLambdaResponse(): { statusCode: number; headers: { "Content-Type": string; "Retry-After": string; }; body: string; }; } /** Invalid request payload. Carries the parsed Zod error details. */ export declare class ValidationError extends AppError { readonly code = "VALIDATION_ERROR"; readonly statusCode = 400; readonly details: unknown; constructor(details: unknown, message?: string); toLambdaResponse(): { statusCode: number; headers: { "Content-Type": string; }; body: string; }; } /** Unrecoverable server error. toLambdaResponse() always returns a generic body — the real cause is preserved for logging only. */ export declare class InternalError extends AppError { readonly code = "INTERNAL_ERROR"; readonly statusCode = 500; readonly cause?: unknown; constructor(message?: string, cause?: unknown); toLambdaResponse(): { statusCode: number; headers: { "Content-Type": string; }; body: string; }; } //# sourceMappingURL=errors.d.ts.map