Skip to content

Commit

Permalink
fix: 记录错误信息 (Close #81)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin committed Apr 27, 2023
1 parent 6430a0b commit 4693cd1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,11 @@ router.post('/chat-process', [auth, limiter], async (req, res) => {
finally {
res.end()
try {
if (result == null || result === undefined || result.status !== 'Success')
if (result == null || result === undefined || result.status !== 'Success') {
if (result && result.status !== 'Success')
lastResponse = { text: result.message }
result = { data: lastResponse }
}

if (result.data === undefined)
// eslint-disable-next-line no-unsafe-finally
Expand Down

0 comments on commit 4693cd1

Please sign in to comment.