Files
Showy/backend/errors/CustomError.js
T

13 lines
285 B
JavaScript

class CustomError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
statusCode() {
return 500; // Default to 500 Internal Server Error
}
}
module.exports = CustomError;