wallet-core: improve error message when store is missing
This commit is contained in:
parent
bc4e2d4147
commit
af4064ce7e
@ -670,6 +670,23 @@ export class DbAccess<StoreMap> {
|
||||
accessibleStores[sn] = swi;
|
||||
}
|
||||
|
||||
const storeMapKeys = Object.keys(this.stores as any);
|
||||
for (const storeMapKey of storeMapKeys) {
|
||||
const swi = (this.stores as any)[storeMapKey] as StoreWithIndexes<
|
||||
any,
|
||||
any,
|
||||
any
|
||||
>;
|
||||
if (!accessibleStores[swi.storeName]) {
|
||||
const version = this.db.version;
|
||||
throw Error(
|
||||
`store '${swi.storeName}' required by schema but not in database (minver=${version})`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
logger.info(`accessible stores: ${Object.keys(accessibleStores)}`);
|
||||
|
||||
const runReadOnly = <T>(
|
||||
txf: ReadOnlyTransactionFunction<StoreMap, T>,
|
||||
): Promise<T> => {
|
||||
|
Loading…
Reference in New Issue
Block a user