Skip to content

Commit 33bfa8d

Browse files
committed
more worker init error handling (2)
1 parent 35f703a commit 33bfa8d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/idb-cache/src/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,6 @@ export class IDBCache implements IDBCacheInterface {
201201
cacheKey?: string,
202202
cacheBuster?: string
203203
): Promise<void> {
204-
if (this.workerInitializationFailed) {
205-
throw new WorkerInitializationError(
206-
"Worker initialization previously failed"
207-
);
208-
}
209-
210204
if (this.workerReadyPromise) {
211205
return this.workerReadyPromise;
212206
}
@@ -245,6 +239,7 @@ export class IDBCache implements IDBCacheInterface {
245239
if (error instanceof IDBCacheError) {
246240
throw error;
247241
}
242+
this.workerInitializationFailed = true;
248243
throw new WorkerInitializationError("Worker failed to initialize.");
249244
}
250245
}

0 commit comments

Comments
 (0)