fix(launcher): handle detached app spawn errors

- Log detached app launch failures before releasing the child process
This commit is contained in:
2026-08-11 19:02:44 -07:00
parent 4a76956257
commit 88cb77efbb
2 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -37,7 +37,10 @@ test('detached app launch policy stays in the startup runtime utilities', () =>
assert.equal(typeof spawnDetachedApp, 'function'); assert.equal(typeof spawnDetachedApp, 'function');
assert.doesNotMatch(entrySource, /function spawnDetachedApp/); 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', () => { test('background bootstrap exits through Electron so Chromium children shut down', () => {
+3
View File
@@ -280,6 +280,9 @@ export function spawnDetachedApp(childArgs: string[], env: NodeJS.ProcessEnv): v
stdio: 'ignore', stdio: 'ignore',
env, env,
}); });
child.once('error', (error) => {
console.error('Failed to spawn detached SubMiner app:', error);
});
child.unref(); child.unref();
} }