Spaces:
Running
Running
File size: 312 Bytes
83848f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | class AppError extends Error {
constructor(message, statusCode) {
super(message);
this.statusCode = statusCode;
this.status = `${statusCode}`.startsWith('4') ? 'fail' : 'error';
this.isOperational = true;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = AppError;
|