Init Commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const ErrorLocalization = require('./errorLocalization')
|
||||
const el = new ErrorLocalization()
|
||||
class AppError extends Error {
|
||||
constructor(name, statusCode, parameters) {
|
||||
super(name)
|
||||
|
||||
this.parameters = parameters
|
||||
this.name = name
|
||||
this.statusCode = statusCode
|
||||
this.status = `${statusCode}`.startsWith(4) ? 'fail' : 'error'
|
||||
this.isOperational = true
|
||||
|
||||
Error.captureStackTrace(this, this.constructor)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AppError
|
||||
Reference in New Issue
Block a user