mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14:41:20 -08:00
fix(thumbnail): [PKG-TOOL-THUMB-07] preserve falsy cleanup exceptions
This commit is contained in:
1 parent
2a38067911
commit
1c522f181b
18 files changed
+5822
-20
No files matched your search
@@ -37,15 +37,19 @@ export function revoke(urls: Set<string>, url: string | undefined) {
|
||||
|
||||
export function cleanupAll(callbacks: Cleanup[]) {
|
||||
let failure: unknown
|
||||
let failed = false
|
||||
for (const callback of callbacks) {
|
||||
try {
|
||||
callback()
|
||||
}
|
||||
catch (error) {
|
||||
failure ||= error
|
||||
if (!failed) {
|
||||
failed = true
|
||||
failure = error
|
||||
}
|
||||
}
|
||||
}
|
||||
if (failure)
|
||||
if (failed)
|
||||
throw failure
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user