fix(app): add catch block to SSE readSSE for stream read errors

Reports stream errors to onError callback instead of silently failing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-04 22:14:31 +00:00
co-authored by Claude Opus 4.6
parent 82f1e99324
commit 9b3fd5d973
3 changed files with 9 additions and 0 deletions
@@ -103,6 +103,9 @@ async function readSSE(
}
}
}
} catch (err) {
if (signal?.aborted) return
onError(err instanceof Error ? err.message : 'Stream read error')
} finally {
reader.cancel().catch(() => {})
}
@@ -109,6 +109,9 @@ async function readSSE(
}
}
}
} catch (err) {
if (signal?.aborted) return
onError(err instanceof Error ? err.message : 'Stream read error')
} finally {
reader.cancel().catch(() => {})
}
+3
View File
@@ -311,6 +311,9 @@ async function readSSE(
}
}
}
} catch (err) {
if (signal?.aborted) return
onError(err instanceof Error ? err.message : 'Stream read error')
} finally {
reader.cancel().catch(() => {})
}