From 1dda183a31b41cf193fae7557f9d9193688e82de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 3 Jun 2020 16:19:42 +0200 Subject: [PATCH] typo --- lib/api/middlewares/error-middleware.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/api/middlewares/error-middleware.js b/lib/api/middlewares/error-middleware.js index f4258383..645a8992 100644 --- a/lib/api/middlewares/error-middleware.js +++ b/lib/api/middlewares/error-middleware.js @@ -4,7 +4,6 @@ module.exports = function errorMiddleware (/* options */) { return function error (err, req, res, next) { const { logger } = res.locals; const errors = populateLimitErrors(Array.isArray(err) ? err : [err]); - let statusCode = findStatusCode(errors[0]); logger.error({ errors }); @@ -14,7 +13,7 @@ module.exports = function errorMiddleware (/* options */) { }; // If a callback was requested, force status to 200 - res.status(req.query.callback ? 200 : statusCode); + res.status(req.query.callback ? 200 : findStatusCode(errors[0])); if (req.query && req.query.callback) { res.jsonp(errorResponseBody);