Enabled all client errors to be displayed

This commit is contained in:
Carlos Jimenez Ruiz 2019-06-27 12:48:47 +02:00
parent 507bc8c2ce
commit f6ddcdf7cc
2 changed files with 8 additions and 2 deletions

View File

@ -3,7 +3,7 @@
"strong-error-handler": {
"params": {
"debug": true,
"log": false
"log": true
}
}
}

View File

@ -24,7 +24,13 @@ module.exports = function() {
if (err.sqlState == '45000')
return next(new UserError(req.__(err.sqlMessage)));
if (!err.statusCode || err.statusCode >= 500)
// Logs error to console
let env = process.env.NODE_ENV;
let useCustomLogging = env && env != 'development' &&
(!err.statusCode || err.statusCode >= 500);
if (useCustomLogging)
logToConsole(req, err);
next(err);