fix serverError handle
Showing
1 changed file
with
3 additions
and
1 deletions
@@ -13,7 +13,9 @@ const checkRefer = helpers.urlFormat('/3party/check', {refer: replaceKey}); | @@ -13,7 +13,9 @@ const checkRefer = helpers.urlFormat('/3party/check', {refer: replaceKey}); | ||
13 | * 服务器错误 | 13 | * 服务器错误 |
14 | * @return {[type]} | 14 | * @return {[type]} |
15 | */ | 15 | */ |
16 | -exports.serverError = (err = {}, req, res, next) => { // eslint-disable-line | 16 | +exports.serverError = (err, req, res, next) => { // eslint-disable-line |
17 | + err = err || {}; | ||
18 | + | ||
17 | logger.error(`error at path: ${req.url}`); | 19 | logger.error(`error at path: ${req.url}`); |
18 | logger.error(`${req.url},${typeof err === 'object' ? JSON.stringify(err) : err}`); | 20 | logger.error(`${req.url},${typeof err === 'object' ? JSON.stringify(err) : err}`); |
19 | 21 |
-
Please register or login to post a comment