This commit is contained in:
2021-10-05 12:54:12 +08:00
parent a7ebffaa49
commit 010fed101f
14 changed files with 228013 additions and 2955 deletions

View File

@ -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);
});