summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-client/src/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-client/src/main.js')
-rw-r--r--packages/meshbay-client/src/main.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/meshbay-client/src/main.js b/packages/meshbay-client/src/main.js
index a348007..6c92531 100644
--- a/packages/meshbay-client/src/main.js
+++ b/packages/meshbay-client/src/main.js
@@ -854,6 +854,13 @@ function registerBridge() {
const bin = await findNodeBinary();
if (!bin) throw new Error('meshbay-node not found on PATH');
const child = spawn(bin, [], { detached: true, stdio: 'ignore', windowsHide: true });
+ // spawn() failures (bad path, a stale PATH entry, antivirus interference)
+ // land on the ChildProcess as an 'error' event, asynchronously -- with no
+ // listener, Node rethrows it as an uncaught exception and takes the whole
+ // main process down with it. The caller's waitForNode() timeout already
+ // turns "never came up" into a clean message; this only has to keep that
+ // path reachable instead of crashing first.
+ child.on('error', (err) => console.error('[node] failed to start:', err.message));
child.unref();
}
@@ -1133,6 +1140,10 @@ function registerBridge() {
detached: true,
stdio: 'ignore',
});
+ // Same reason as spawnNodeDetached(): an unhandled 'error' event here
+ // would crash the whole main process instead of letting the polling
+ // loop below report "never came up".
+ child.on('error', (err) => console.error('[node] failed to start:', err.message));
child.unref();
}