UNPKG

expresss-ts

Version:

CLI to create an Express TypeScript starter project

20 lines (19 loc) 562 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ApiError extends Error { constructor(statusCode, message = "Something went wrong", errors = [], stack = "") { super(message); this.statusCode = statusCode; this.data = null; this.message = message; this.success = false; this.errors = errors; if (stack) { this.stack = stack; } else { Error.captureStackTrace(this, this.constructor); } } } exports.default = ApiError;