...
|
...
|
@@ -57,6 +57,8 @@ exports.notFound = () => { |
|
|
* @return {[type]}
|
|
|
*/
|
|
|
exports.serverError = () => {
|
|
|
const statusCodeList = [403];
|
|
|
|
|
|
return async(err, req, res, next) => {
|
|
|
forceNoCache(res);
|
|
|
|
...
|
...
|
@@ -70,6 +72,10 @@ exports.serverError = () => { |
|
|
|
|
|
err.code = parseInt(err.code || err.statusCode, 10) || 500;
|
|
|
|
|
|
if (statusCodeList.indexOf(err.code) >= 0) {
|
|
|
errorCode = err.code;
|
|
|
}
|
|
|
|
|
|
if (req.isApmReport && !err.apiError) { // apierror在node lib中已经上报过了 不需要再次上报
|
|
|
// 上报服务端错误
|
|
|
sender.addMessage({
|
...
|
...
|
|