mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 06:30:10 +08:00
fix(HomeWindow): improve error handling for chunk processing in HomeWindow component
This commit is contained in:
parent
97b7eebf7d
commit
6d2f24ac3a
@ -340,10 +340,23 @@ const HomeWindow: FC = () => {
|
||||
)
|
||||
}
|
||||
break
|
||||
case ChunkType.ERROR:
|
||||
case ChunkType.ERROR: {
|
||||
const possibleBlockId = thinkingBlockId || blockId
|
||||
if (possibleBlockId) {
|
||||
store.dispatch(
|
||||
updateOneBlock({
|
||||
id: possibleBlockId,
|
||||
changes: {
|
||||
status: isAbortError(chunk.error) ? MessageBlockStatus.PAUSED : MessageBlockStatus.ERROR
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
if (!isAbortError(chunk.error)) {
|
||||
throw new Error(chunk.error.message)
|
||||
}
|
||||
break
|
||||
}
|
||||
//fall through
|
||||
case ChunkType.BLOCK_COMPLETE:
|
||||
setIsLoading(false)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user