UNPKG

very-express

Version:

based on json schema and openapi, generate Express RestApi server with mongoDb

25 lines (22 loc) 722 B
/** * Generated by veryExpress@0.6.6-alpha * https://github.com/Justin26l/VeryExpress */ import { ResponseCode } from "./../../_utils/response.gen"; import utils from "./../../_utils/index"; export class VexResErr extends Error { public status: number; public ret_code: ResponseCode | string; public ret_msg: any; constructor( status: number = 200, code?: ResponseCode | null, message?: string, ) { super(message); this.name = "VexResErr"; this.status = status; this.ret_code = code || utils.response.statusCodeMap.get(status) || utils.response.code.SERVER_ERROR; this.ret_msg = message || utils.response.msg.SERVER_ERROR; } }