fix(thumbnail): [PKG-TOOL-THUMB-07] preserve falsy cleanup exceptions

This commit is contained in:
Harvey Zhao committed 2026-09-15 15:30:26 +08:00
1 parent 2a38067911
commit 1c522f181b
18 files changed
+5822 -20

No files matched your search

+6 -2
View File
@@ -115,14 +115,18 @@ function revoke(urls, url) {
}
function cleanupAll(callbacks) {
let failure;
let failed = false;
for (const callback of callbacks) {
try {
callback();
} catch (error) {
failure || (failure = error);
if (!failed) {
failed = true;
failure = error;
}
}
}
if (failure)
if (failed)
throw failure;
}
function closeState(tool, reason = "destroyed") {