import type { Request, Response } from 'express'; import type { ExceptionHandler } from './Handler.js'; import type { HttpExceptionInterface } from './HttpExceptionInterface.js'; /** * Base HTTP exception with status, optional headers, and optional custom render/report hooks. */ export declare class HttpException extends Error implements HttpExceptionInterface { readonly statusCode: number; readonly headers: Record; readonly code: string; constructor(statusCode: number, message?: string, headers?: Record, code?: string); /** * Override in subclass to produce a custom HTTP response. * If this returns void/undefined, the default rendering is used. */ render?(req: Request, res: Response): Response | void | Promise; /** * Override in subclass to do custom reporting (e.g. alert Sentry, Slack). * If this method exists, the default report() logic is skipped. */ report?(handler?: ExceptionHandler): void | Promise; /** * Add extra context that will be merged into the log entry. */ context?(): Record; /** Default message for a status code (e.g. 404 → 'Not Found'). */ static defaultMessageForStatus(status: number): string; /** Default machine code for a status code (e.g. 404 → 'NOT_FOUND'). */ static defaultCodeForStatus(status: number): string; } //# sourceMappingURL=HttpException.d.ts.map