typo
This commit is contained in:
parent
0eadfe6ee9
commit
1dda183a31
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user