slightly more helpful error message

This commit is contained in:
Florian Dold 2020-12-14 16:45:10 +01:00
parent 12234083ec
commit c4b44a5109
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -206,7 +206,13 @@ export class BridgeIDBObjectStore {
if (key instanceof BridgeIDBKeyRange) { if (key instanceof BridgeIDBKeyRange) {
keyRange = key; keyRange = key;
} else { } else {
keyRange = BridgeIDBKeyRange.only(valueToKey(key)); try {
keyRange = BridgeIDBKeyRange.only(valueToKey(key));
} catch (e) {
throw Error(
`invalid key (type ${typeof key}) for object store ${this._name}`,
);
}
} }
const recordRequest: RecordGetRequest = { const recordRequest: RecordGetRequest = {