Skip to content

Commit

Permalink
library_idbfs.js: Also use e.target.error for transaction.onerror
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Feb 14, 2024
1 parent 68048bf commit 4d24e0d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/library_idbfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ addToLibrary({
}
};

transaction.onerror = (e) => {
done(this.error);
// transaction may abort if (for example) there is a QuotaExceededError
transaction.onerror = transaction.onabort = (e) => {
done(e.target.error);
e.preventDefault();
};

Expand All @@ -280,12 +281,6 @@ addToLibrary({
}
};

// transaction may abort if (for example) there is a QuotaExceededError
transaction.onabort = (e) => {
done(e.target.error); // DOMException
e.preventDefault();
};

// sort paths in ascending order so directory entries are created
// before the files inside them
create.sort().forEach((path) => {
Expand Down

0 comments on commit 4d24e0d

Please sign in to comment.