Skip to content

Commit

Permalink
fix: leave chat page show assign to readonly property prolem (langgen…
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjoel authored Aug 12, 2024
1 parent ccb6ddd commit 12dd3c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/service/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,15 @@ export const ssePost = (
return handleStream(res, (str: string, isFirstMessage: boolean, moreInfo: IOnDataMoreInfo) => {
if (moreInfo.errorMessage) {
onError?.(moreInfo.errorMessage, moreInfo.errorCode)
if (moreInfo.errorMessage !== 'AbortError: The user aborted a request.')
// TypeError: Cannot assign to read only property ... will happen in page leave, so it should be ignored.
if (moreInfo.errorMessage !== 'AbortError: The user aborted a request.' && !moreInfo.errorMessage.includes('TypeError: Cannot assign to read only property'))
Toast.notify({ type: 'error', message: moreInfo.errorMessage })
return
}
onData?.(str, isFirstMessage, moreInfo)
}, onCompleted, onThought, onMessageEnd, onMessageReplace, onFile, onWorkflowStarted, onWorkflowFinished, onNodeStarted, onNodeFinished, onIterationStart, onIterationNext, onIterationFinish, onTextChunk, onTTSChunk, onTTSEnd, onTextReplace)
}).catch((e) => {
if (e.toString() !== 'AbortError: The user aborted a request.')
if (e.toString() !== 'AbortError: The user aborted a request.' && !e.toString().errorMessage.includes('TypeError: Cannot assign to read only property'))
Toast.notify({ type: 'error', message: e })
onError?.(e)
})
Expand Down

0 comments on commit 12dd3c0

Please sign in to comment.