diff --git a/src/main-entry-runtime.test.ts b/src/main-entry-runtime.test.ts index 3e95c9b9..a41a100e 100644 --- a/src/main-entry-runtime.test.ts +++ b/src/main-entry-runtime.test.ts @@ -37,7 +37,10 @@ test('detached app launch policy stays in the startup runtime utilities', () => assert.equal(typeof spawnDetachedApp, 'function'); assert.doesNotMatch(entrySource, /function spawnDetachedApp/); - assert.match(runtimeSource, /child\.unref\(\)/); + assert.match( + runtimeSource, + /child\.once\('error', \(error\) => \{\s*console\.error\([^;]*error\);\s*\}\);\s*child\.unref\(\)/, + ); }); test('background bootstrap exits through Electron so Chromium children shut down', () => { diff --git a/src/main-entry-runtime.ts b/src/main-entry-runtime.ts index 0816fff4..34bcfe10 100644 --- a/src/main-entry-runtime.ts +++ b/src/main-entry-runtime.ts @@ -280,6 +280,9 @@ export function spawnDetachedApp(childArgs: string[], env: NodeJS.ProcessEnv): v stdio: 'ignore', env, }); + child.once('error', (error) => { + console.error('Failed to spawn detached SubMiner app:', error); + }); child.unref(); }