Skip to content

Commit b7b63e6

Browse files
committed
library_idbfs.js: Also use e.target.error for transaction.onerror
1 parent a52a416 commit b7b63e6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/library_idbfs.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,9 @@ addToLibrary({
269269
}
270270
};
271271

272-
transaction.onerror = (e) => {
273-
done(this.error);
272+
// transaction may abort if (for example) there is a QuotaExceededError
273+
transaction.onerror = transaction.onabort = (e) => {
274+
done(e.target.error);
274275
e.preventDefault();
275276
};
276277

@@ -280,12 +281,6 @@ addToLibrary({
280281
}
281282
};
282283

283-
// transaction may abort if (for example) there is a QuotaExceededError
284-
transaction.onabort = (e) => {
285-
done(e.target.error); // DOMException
286-
e.preventDefault();
287-
};
288-
289284
// sort paths in ascending order so directory entries are created
290285
// before the files inside them
291286
create.sort().forEach((path) => {

0 commit comments

Comments
 (0)