diff --git a/lib/handleError.js b/lib/handleError.js index 34468e8..5f2c48b 100644 --- a/lib/handleError.js +++ b/lib/handleError.js @@ -33,7 +33,7 @@ function handleError (reporter) { } const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl - let logFn + const logFn = err.weak ? reporter.logger.warn : reporter.logger.error let msg let isJSON = false @@ -41,8 +41,6 @@ function handleError (reporter) { res.status(statusCode != null ? statusCode : 400) } - logFn = err.weak ? reporter.logger.warn : reporter.logger.error - if ( (req.get('Content-Type') && (req.get('Content-Type').indexOf('application/json') !== -1)) ||