mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
10 lines
No EOL
319 B
JavaScript
10 lines
No EOL
319 B
JavaScript
class AppError extends Error {
|
|
constructor(errorCode = { message: "Something went wrong", code: 500 }) {
|
|
super(errorCode.message);
|
|
this.statusCode = errorCode.code || 500;
|
|
this.isOperational = true;
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
}
|
|
|
|
module.exports = AppError; |