@acruzjr/express-http-errors
Version:
The easiest way to handle errors in Express.
24 lines • 573 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpError = void 0;
class HttpError extends Error {
constructor(message, error) {
super(message);
this.message = message;
this.error = error;
}
send(res) {
res.status(this.status).send({
code: this.status,
message: this.message,
error: this.error,
});
}
postBuild() {
/**
* nothing todo
*/
}
}
exports.HttpError = HttpError;
//# sourceMappingURL=HttpError.js.map
;