UNPKG

@lottojs/ciapa

Version:

Sto bibliotecheto fato in JavaScript, te permete de farghe le chiamate HTTP e ciapar tute le informazioni che te serve par el to progèto.

36 lines 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CiapaError = void 0; class AppError extends Error { constructor(message) { super(message); Object.setPrototypeOf(this, AppError.prototype); Error.captureStackTrace(this, AppError.captureStackTrace); } } class CiapaError extends AppError { constructor(message, status, parent) { super(message); this.status = status; const description = parent ? `${parent.constructor.name}: ${parent.message}` : message; const stack = process.env.STAGE === 'staging' ? parent ? parent.stack : this.stack : undefined; const error = { success: false, statusCode: status, description, stack, }; this.message = JSON.stringify(error); this.statusCode = status; this.expose = true; Object.setPrototypeOf(this, CiapaError.prototype); } } exports.CiapaError = CiapaError; //# sourceMappingURL=error.js.map