feat(Errors): Add global error handling
This commit is contained in:
committed by
Benedikt Rötsch
parent
17b52868e2
commit
64f59e203d
@@ -7,6 +7,8 @@
|
||||
|
||||
exports.catchErrors = (fn) => {
|
||||
return function (req, res, next) {
|
||||
return fn(req, res, next).catch(next)
|
||||
return fn(req, res, next).catch((e) => {
|
||||
next(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user