mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 04:39:05 +08:00
fix: user cancel conversation show error (#558)
This commit is contained in:
parent
054ba88434
commit
dbe10799e3
@ -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)
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user