+ Error handler and refactoring of the http methods
This commit is contained in:
13
models/Errors.js
Normal file
13
models/Errors.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// Http error w/ code
|
||||
class HttpError extends Error {
|
||||
constructor(code, message) {
|
||||
super(message)
|
||||
this.name = "HttpError"
|
||||
this.code = code
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
HttpError
|
||||
}
|
||||
Reference in New Issue
Block a user