From 324fae515356193ee1d5f447a1031cdb14c5900d Mon Sep 17 00:00:00 2001 From: Vanilagy <1696106+Vanilagy@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:42:02 +0200 Subject: [PATCH] Adjusted error management in ReadOrchestrator (closes #405) --- src/source.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/source.ts b/src/source.ts index d181a14..a8975dd 100644 --- a/src/source.ts +++ b/src/source.ts @@ -1989,6 +1989,14 @@ class ReadOrchestrator { } satisfies ReadResult)); } else { // The requested region was satisfied by the cache, but the entire prefetch region was not + promise.catch((error) => { + if (this.disposed) { + return; // Swallow the error + } + + // Nobody's awaiting this result but an errored read is still notable + throw error; + }); } return result; @@ -2103,7 +2111,7 @@ class ReadOrchestrator { if (worker.pendingSlices.length > 0) { worker.pendingSlices.forEach(x => x.reject(error)); // Make sure to propagate any errors worker.pendingSlices.length = 0; - } else { + } else if (!worker.aborted && !this.disposed) { throw error; // So it doesn't get swallowed } })