|
|
|
@ -45,7 +45,7 @@ exports.handleErrors = function (err, req, res, next) { // eslint-disable-line n
|
|
|
|
|
|
|
|
|
|
var status = parseInt(err.status, 10);
|
|
|
|
|
if ((status === 302 || status === 308) && err.path) {
|
|
|
|
|
return res.locals.isAPI ? res.status(status).json(err.path) : res.redirect(err.path);
|
|
|
|
|
return res.locals.isAPI ? res.set('X-Redirect', err.path).status(200).json(err.path) : res.redirect(err.path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
winston.error(req.path + '\n', err.stack);
|
|
|
|
|