gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 03/03: wallet-core: improve error message when store


From: gnunet
Subject: [taler-wallet-core] 03/03: wallet-core: improve error message when store is missing
Date: Fri, 27 Jan 2023 12:38:30 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

commit af4064ce7e1bedbad478a032b44852e78e2753ef
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri Jan 27 12:38:08 2023 +0100

    wallet-core: improve error message when store is missing
---
 packages/taler-wallet-core/src/util/query.ts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/packages/taler-wallet-core/src/util/query.ts 
b/packages/taler-wallet-core/src/util/query.ts
index 56a23c2dd..0efda88cf 100644
--- a/packages/taler-wallet-core/src/util/query.ts
+++ b/packages/taler-wallet-core/src/util/query.ts
@@ -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> => {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]