Log more info for internal errors in debug mode

This commit is contained in:
Jamie Curnow 2021-09-09 08:46:09 +10:00
parent fb8f2c2f9a
commit b96c996a45

View File

@ -75,7 +75,7 @@ app.use(function (err, req, res, next) {
// Not every error is worth logging - but this is good for now until it gets annoying.
if (typeof err.stack !== 'undefined' && err.stack) {
if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV === 'development' || process.env.DEBUG) {
log.debug(err.stack);
} else if (typeof err.public == 'undefined' || !err.public) {
log.warn(err.message);