Skip to content

Commit f943cc5

Browse files
committed
feat: Raise error when can not generate prompt
1 parent 8f16358 commit f943cc5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ui/src/views/application/component/GeneratePromptDialog.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ const getWrite = (reader: any) => {
309309
if (split) {
310310
for (const index in split) {
311311
const chunk = JSON?.parse(split[index].replace('data:', ''))
312+
if (chunk.error) {
313+
loading.value = false
314+
stopStreaming()
315+
middleAnswer.content = chunk.error
316+
return Promise.reject(new Error(chunk.error))
317+
}
312318
if (!chunk.is_end) {
313319
// 实时将新接收的内容添加到完整内容中
314320
fullContent.value += chunk.content

0 commit comments

Comments
 (0)