Skip to content

Commit

Permalink
Backport error handling fix from jakearchibald/idb-keyval#164
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed Aug 22, 2023
1 parent c02208f commit 27757d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/storage/idb-keyval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class Store {
new Promise<void>((resolve, reject) => {
const transaction = db.transaction(this.storeName, type);
transaction.oncomplete = () => resolve();
transaction.onabort = transaction.onerror = () => reject(transaction.error);
transaction.onerror = (e) => reject((e.target as IDBTransaction).error);
transaction.onabort = () => reject(transaction.error);
callback(transaction.objectStore(this.storeName));
})
);
Expand Down

0 comments on commit 27757d9

Please sign in to comment.