UNPKG

catch-async-wrapper-express

Version:

middleware for handling exceptions inside of async express routes and passing them to your express or custom error handlers

16 lines (15 loc) 481 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CatchAsyncError = void 0; class CatchAsyncError extends Error { constructor(message, code, error) { super(message); this.message = message; this.code = code; this.error = error; this.name = 'CatchAsyncError'; Error.captureStackTrace(this, this.constructor); } } exports.CatchAsyncError = CatchAsyncError; exports.default = CatchAsyncError;