Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: user cancel conversation show error (#558)

Joeldbe10799e386
diff --git a/web/service/base.ts b/web/service/base.ts
index 019c8d5d0e9..628b1c4955a 100644
--- a/web/service/base.ts
+++ b/web/service/base.ts
@@ -334,13 +334,16 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o
return handleStream(res, (str: string, isFirstMessage: boolean, moreInfo: IOnDataMoreInfo) => {
if (moreInfo.errorMessage) {
onError?.(moreInfo.errorMessage)
- Toast.notify({ type: 'error', message: moreInfo.errorMessage })
+ if (moreInfo.errorMessage !== 'AbortError: The user aborted a request.')
+ Toast.notify({ type: 'error', message: moreInfo.errorMessage })
return
}
onData?.(str, isFirstMessage, moreInfo)
}, onCompleted)
}).catch((e) => {
- Toast.notify({ type: 'error', message: e })
+ if (e.toString() !== 'AbortError: The user aborted a request.')
+ Toast.notify({ type: 'error', message: e })
+
onError?.(e)
})
}