Commit 197fcee7 authored by Joel's avatar Joel

test error

parent 8e2bdbf3
...@@ -341,6 +341,7 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o ...@@ -341,6 +341,7 @@ 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) {
console.log(moreInfo.errorMessage)
onError?.(moreInfo.errorMessage) onError?.(moreInfo.errorMessage)
Toast.notify({ type: 'error', message: moreInfo.errorMessage }) Toast.notify({ type: 'error', message: moreInfo.errorMessage })
return return
...@@ -348,6 +349,7 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o ...@@ -348,6 +349,7 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o
onData?.(str, isFirstMessage, moreInfo) onData?.(str, isFirstMessage, moreInfo)
}, onCompleted) }, onCompleted)
}).catch((e) => { }).catch((e) => {
console.log(e.toString())
if (e.toString() !== 'AbortError: The user aborted a request.') if (e.toString() !== 'AbortError: The user aborted a request.')
Toast.notify({ type: 'error', message: e }) Toast.notify({ type: 'error', message: 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