mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
fix(cli): handle Bun stream cancellation errors
This commit is contained in:
@@ -35,7 +35,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
|
||||
const id = setTimeout(() => {
|
||||
const err = new Error("SSE read timed out")
|
||||
ctl.abort(err)
|
||||
void reader.cancel(err)
|
||||
void reader.cancel(err).catch(() => undefined) // kilocode_change - handle Bun 1.4 cancellation rejection
|
||||
reject(err)
|
||||
}, ms)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
|
||||
const id = setTimeout(() => {
|
||||
const err = new ProviderError.ResponseStreamError("SSE read timed out")
|
||||
ctl.abort(err)
|
||||
void reader.cancel(err)
|
||||
void reader.cancel(err).catch(() => undefined) // kilocode_change - handle Bun 1.4 cancellation rejection
|
||||
reject(err)
|
||||
}, ms)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user