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:
co-authored by
Claude Opus 4.6
parent
82f1e99324
commit
9b3fd5d973
@@ -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(() => {})
|
||||
}
|
||||
|
||||
@@ -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(() => {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user