diff --git a/service/src/index.ts b/service/src/index.ts index 0748f3e2..207a095c 100644 --- a/service/src/index.ts +++ b/service/src/index.ts @@ -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