Authored by yyq

fix serverError handle

@@ -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