import { HttpStatus } from "../enum"; /** * HttpException * @author ranyunlong<549510622@qq.com> * license MIT */ export interface Properties{ [key: string]: any; } export interface HttpExceptionOptions{ status?: HttpStatus; message?: string; properties?: Properties | boolean; error?: Properties; } export interface HttpExceptionInterface extends Error { message: any; status?: HttpStatus properties?: Properties | boolean; error?: Properties; } export class HttpException extends Error implements HttpExceptionInterface{ public message: any; public status: HttpStatus; public properties: Properties | boolean; public error: Properties; constructor(options?: HttpExceptionOptions) { super(options.message) this.properties = options.properties this.status = options.status this.error = options.error this.name = 'HttpException' } }