Skip to content

Commit 27757d9

Browse files
committed
Backport error handling fix from jakearchibald/idb-keyval#164
1 parent c02208f commit 27757d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/storage/idb-keyval.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export class Store {
4545
new Promise<void>((resolve, reject) => {
4646
const transaction = db.transaction(this.storeName, type);
4747
transaction.oncomplete = () => resolve();
48-
transaction.onabort = transaction.onerror = () => reject(transaction.error);
48+
transaction.onerror = (e) => reject((e.target as IDBTransaction).error);
49+
transaction.onabort = () => reject(transaction.error);
4950
callback(transaction.objectStore(this.storeName));
5051
})
5152
);

0 commit comments

Comments
 (0)