mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Clarify that we no-op because if it's already aborted, that's what we wanted to do anyway (#861)
Split off from https://github.com/vector-im/hydrogen-web/pull/653
This commit is contained in:
parent
2416893718
commit
b4f4636555
@ -83,7 +83,11 @@ export function openDatabase(name: string, createObjectStore: CreateObjectStore,
|
|||||||
// try aborting on error, if that hasn't been done already
|
// try aborting on error, if that hasn't been done already
|
||||||
try {
|
try {
|
||||||
txn.abort();
|
txn.abort();
|
||||||
} catch (err) {}
|
} catch (err) {
|
||||||
|
// No-op: `InvalidStateError` is only thrown if the transaction has
|
||||||
|
// already been committed or aborted. Since we wanted the txn to
|
||||||
|
// be aborted anyway, it doesn't matter if this fails.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return reqAsPromise(req);
|
return reqAsPromise(req);
|
||||||
|
Loading…
Reference in New Issue
Block a user