mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-22 00:13:09 +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
|
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)) {
|
if (!isAbortError(chunk.error)) {
|
||||||
throw new Error(chunk.error.message)
|
throw new Error(chunk.error.message)
|
||||||
}
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
//fall through
|
//fall through
|
||||||
case ChunkType.BLOCK_COMPLETE:
|
case ChunkType.BLOCK_COMPLETE:
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user