UNPKG

sipp

Version:

An Opinionated, High-Productivity MVC Web Framework in TypeScript

16 lines (15 loc) 885 B
import { BaseException } from './BaseException'; import { Logger } from '../logger'; import { Request, Response } from 'express'; import { HTTPResponder } from '../http/response/Responder'; import { HTTPResponse, ResponseBody } from '../http'; declare type ExceptionHandledResponse = ResponseBody | HTTPResponse<any> | false | Promise<ResponseBody | HTTPResponse<any> | false>; export declare class ExceptionHandler extends HTTPResponder { protected readonly logger: Logger; protected readonly mode: 'production' | 'development' | string; constructor(logger: Logger, mode: 'production' | 'development' | string); handle(exception: BaseException, req: Request, res: Response): ExceptionHandledResponse; reportHandledException(exception: BaseException): void | Promise<void>; reportUnhandledException(exception: BaseException): void | Promise<void>; } export {};