Fix main-process crash on SSH connection errors: handle repeated ssh2 error events, use the Windows OpenSSH agent only when it is running, show uncaught errors as a toast

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 22:51:33 +02:00
co-authored by Claude Opus 5.5
parent 7a9b70e645
commit 487ed069fc
3 changed files with 25 additions and 5 deletions
+7
View File
@@ -32,6 +32,13 @@ if (process.platform === 'linux' && readLaunch().x11 !== false && !process.argv.
}
const pendingSecrets = new Map();
// Sicherheitsnetz: unerwartete Fehler (z. B. aus Netzwerkbibliotheken) als Meldung anzeigen statt den Hauptprozess abstürzen zu lassen
process.on('uncaughtException', (e) => {
console.error('Uncaught exception:', e);
send('toast', e?.message || String(e), 'error');
});
process.on('unhandledRejection', (e) => console.error('Unhandled rejection:', e));
function send(channel, ...args) {
if (win && !win.isDestroyed()) win.webContents.send(channel, ...args);
}