import { Context } from '../context.js'; export declare const ErrorHandler: unique symbol; export declare const ErrorMessageResolver: unique symbol; export declare const DEFAULT_ERROR_HANDLER_PRIORITY = 1; export declare const HTTP_ERROR_HANDLER_PRIORITY: number; export declare const VALIDATION_ERRORS_ERROR_HANDLER_PRIORITY: number; export interface ErrorHandler { /** * The priority value must be greater than the default Error Handler's priority: DEFAULT_ERROR_HANDLER_PRIORITY, otherwise it will never be executed. */ readonly priority: number; canHandle(ctx: Context, err: Error): Promise; handle(ctx: Context, err: Error): Promise; } /** What the client is told about an error. */ export interface ErrorResponse { status: number; message: string; } /** Decides the status and the message an error answers with; error handlers and the mvc JSON view use it. */ export interface ErrorMessageResolver { resolve(error: unknown): ErrorResponse; }