Unverified Commit dbe10799 authored by Joel's avatar Joel Committed by GitHub

fix: user cancel conversation show error (#558)

parent 054ba884
...@@ -334,13 +334,16 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o ...@@ -334,13 +334,16 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o
return handleStream(res, (str: string, isFirstMessage: boolean, moreInfo: IOnDataMoreInfo) => { return handleStream(res, (str: string, isFirstMessage: boolean, moreInfo: IOnDataMoreInfo) => {
if (moreInfo.errorMessage) { if (moreInfo.errorMessage) {
onError?.(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 return
} }
onData?.(str, isFirstMessage, moreInfo) onData?.(str, isFirstMessage, moreInfo)
}, onCompleted) }, onCompleted)
}).catch((e) => { }).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) onError?.(e)
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment