@rafat97/exceptionhandler
Version:
All types exception handler classes definition
24 lines • 855 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.All4xxException = void 0;
const CustomError_1 = require("./CustomError");
class All4xxException extends CustomError_1.CustomError {
constructor(message, statusCode = 400, details = []) {
super(message);
this.message = message;
this.statusCode = 404;
if (statusCode >= 400 && statusCode < 500) {
this.statusCode = statusCode || this.statusCode;
}
this.details = details;
Object.setPrototypeOf(this, All4xxException.prototype);
}
getStatusCode() {
return this.statusCode;
}
serializeErrors() {
return { message: this.message, details: this.details };
}
}
exports.All4xxException = All4xxException;
//# sourceMappingURL=All4xxException.js.map