mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Add case where errorhandlerr does not receive an error
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
} from '../../libs/api-v3/errors';
|
||||
|
||||
export default function errorHandler (err, req, res, next) {
|
||||
if (!err) return next();
|
||||
|
||||
// Log the original error with some metadata
|
||||
let stack = err.stack || err.message || err;
|
||||
logger.error(stack, {
|
||||
|
||||
Reference in New Issue
Block a user