修改错误日志

This commit is contained in:
luying
2022-07-26 20:47:01 +08:00
parent ab7d406a26
commit 2fb70171ea
4 changed files with 21 additions and 16 deletions
+4 -1
View File
@@ -170,8 +170,11 @@ app.configure(ALL_ENVS, 'activity', function () {
function errorHandler(err: Error, msg: any, resp: any,
session: FrontendOrBackendSession, cb: HandlerCallback) {
const errCode = genCode(10);
if(err.message != 'globalFilter')
if(err.message == 'globalFilter') {
infologger.debug('global after ', msg && JSON.stringify(msg), resp && JSON.stringify(resp), session && session.get('roleId'));
} else {
errlogger.error(`${pinus.app.serverId} error handler \n msg[${JSON.stringify(msg)}] \n resp[${JSON.stringify(resp)}] \n sessionId:${JSON.stringify(session.export())} \n error 【${errCode}】 stack: ${err.stack}`);
}
if (!resp) {
resp = resResult(STATUS.GLOBAL_ERR, { errCode, stack: err.stack });