Enabled all client errors to be displayed
This commit is contained in:
parent
507bc8c2ce
commit
f6ddcdf7cc
|
@ -3,7 +3,7 @@
|
|||
"strong-error-handler": {
|
||||
"params": {
|
||||
"debug": true,
|
||||
"log": false
|
||||
"log": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue