fix(HomeWindow): improve error handling for chunk processing in HomeWindow component

This commit is contained in:
suyao 2025-06-18 19:05:44 +08:00
parent 97b7eebf7d
commit 6d2f24ac3a
No known key found for this signature in database

View File

@ -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)