Authored by 陈峰

Merge branch 'feature/safety' into 'gray'

Feature/safety



See merge request !1455
... ... @@ -106,9 +106,11 @@ exports.serverError = () => {
forceNoCache(res);
err.code = err.code || err.statusCode || 500;
err = err || {};
if (!err.type === 'entity.parse.failed') { // json 解析失败不上报错误
err.code = parseInt(err.code || err.statusCode, 10) || 500;
if (err.type !== 'entity.parse.failed') { // json 解析失败不上报错误
logger.error(`error at path: ${req.url}`);
logger.error(err);
}
... ... @@ -199,7 +201,7 @@ exports.serverError = () => {
}
if (!res.headersSent) {
return _err500(req, res, err.code, err);
return _err500(req, res, 500, err);
}
return next(err);
... ...