gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: idb-bridge: improve error rep


From: gnunet
Subject: [taler-wallet-core] branch master updated: idb-bridge: improve error reporting for sqlite3 helper
Date: Tue, 07 Jan 2025 20:40:22 +0100

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 7eb77387e idb-bridge: improve error reporting for sqlite3 helper
7eb77387e is described below

commit 7eb77387e8d1c8f929946f0c1564484c50b2637e
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Jan 7 20:40:19 2025 +0100

    idb-bridge: improve error reporting for sqlite3 helper
---
 packages/idb-bridge/src/node-helper-sqlite3-impl.ts | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/packages/idb-bridge/src/node-helper-sqlite3-impl.ts 
b/packages/idb-bridge/src/node-helper-sqlite3-impl.ts
index 3ba37576b..9101b2f6f 100644
--- a/packages/idb-bridge/src/node-helper-sqlite3-impl.ts
+++ b/packages/idb-bridge/src/node-helper-sqlite3-impl.ts
@@ -74,12 +74,21 @@ class Helper {
   private enableTracing: boolean;
   private isListening: boolean = false;
   public proc: ChildProcessByStdio<stream.Writable, stream.Readable, null>;
+  private promStarted: Promise<void>;
 
   constructor(opts?: { enableTracing: boolean }) {
     this.enableTracing = opts?.enableTracing ?? false;
     this.proc = child_process.spawn("taler-helper-sqlite3", {
       stdio: ["pipe", "pipe", "inherit"],
     });
+    const startedPromcap = openPromise<void>();
+    this.promStarted = startedPromcap.promise;
+    this.proc.on("error", (err: Error) => {
+      startedPromcap.reject(err);
+    });
+    this.proc.on("spawn", () => {
+      startedPromcap.resolve();
+    });
     // Make sure that the process is not blocking the parent process
     // from exiting.
     // When we are actively waiting for a response, we ref it again.
@@ -168,6 +177,7 @@ class Helper {
   }
 
   async communicate(cmd: number, payload: Uint8Array): Promise<Uint8Array> {
+    await this.promStarted;
     if (!this.isListening) {
       this.startListening();
     }

-- 
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]