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:
Eric Eastwood 2022-10-17 15:56:34 -05:00 committed by GitHub
parent 2416893718
commit b4f4636555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,11 @@ export function openDatabase(name: string, createObjectStore: CreateObjectStore,
// try aborting on error, if that hasn't been done already
try {
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);