Update.
This commit is contained in:
@ -5,8 +5,8 @@
|
||||
export default function asyncHandler(handler) {
|
||||
return (req, res, next) => {
|
||||
Promise.resolve(handler(req, res, next)).catch(error => {
|
||||
req.log.error(`Unexpected error in ${handler.name}!`);
|
||||
req.log.error(error.stack);
|
||||
console.error(`Unexpected error in ${handler.name}!`);
|
||||
console.error(error.stack);
|
||||
|
||||
next(error);
|
||||
});
|
||||
|
Reference in New Issue
Block a user