chore: 异常打印和调整日志

This commit is contained in:
ChenZhaoYu
2023-03-09 22:58:06 +08:00
parent d7d037618f
commit c17cc16c0e
2 changed files with 4 additions and 1 deletions

View File

@@ -111,6 +111,7 @@ async function chatReplyProcess(
}
catch (error: any) {
const code = error.statusCode
global.console.log(error)
if (Reflect.has(ErrorCodeMessage, code))
return sendResponse({ type: 'Fail', message: ErrorCodeMessage[code] })
return sendResponse({ type: 'Fail', message: error.message ?? 'Please check the back-end console' })