mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-09 00:33:46 +02:00
Adjusted error management in ReadOrchestrator (closes #405)
This commit is contained in:
+9
-1
@@ -1989,6 +1989,14 @@ class ReadOrchestrator {
|
|||||||
} satisfies ReadResult));
|
} satisfies ReadResult));
|
||||||
} else {
|
} else {
|
||||||
// The requested region was satisfied by the cache, but the entire prefetch region was not
|
// 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;
|
return result;
|
||||||
@@ -2103,7 +2111,7 @@ class ReadOrchestrator {
|
|||||||
if (worker.pendingSlices.length > 0) {
|
if (worker.pendingSlices.length > 0) {
|
||||||
worker.pendingSlices.forEach(x => x.reject(error)); // Make sure to propagate any errors
|
worker.pendingSlices.forEach(x => x.reject(error)); // Make sure to propagate any errors
|
||||||
worker.pendingSlices.length = 0;
|
worker.pendingSlices.length = 0;
|
||||||
} else {
|
} else if (!worker.aborted && !this.disposed) {
|
||||||
throw error; // So it doesn't get swallowed
|
throw error; // So it doesn't get swallowed
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user