Skip to content

Commit 4693cd1

Browse files
author
Kerwin
committed
fix: 记录错误信息 (Close #81)
1 parent 6430a0b commit 4693cd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

service/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,11 @@ router.post('/chat-process', [auth, limiter], async (req, res) => {
351351
finally {
352352
res.end()
353353
try {
354-
if (result == null || result === undefined || result.status !== 'Success')
354+
if (result == null || result === undefined || result.status !== 'Success') {
355+
if (result && result.status !== 'Success')
356+
lastResponse = { text: result.message }
355357
result = { data: lastResponse }
358+
}
356359

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

0 commit comments

Comments
 (0)