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

@ -2,8 +2,10 @@
`2023-03-09` `2023-03-09`
衔接 `2.10.1` 版本[详情](https://github.com/Chanzhaoyu/chatgpt-web/releases/tag/v2.10.1)
## BugFix ## BugFix
- 修复 `2.10.1` 中添加 `OPENAI_API_MODEL` 变量的判断错误,会导致默认模型指定失效 - 修复 `2.10.1` 中添加 `OPENAI_API_MODEL` 变量的判断错误,会导致默认模型指定失效,抱歉
## v2.10.1 ## v2.10.1

View File

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