SYNC: handle subprocess errors

This commit is contained in:
SPRINX0\prochazka
2025-04-09 09:40:24 +02:00
committed by Diflow
parent 4b3c0466eb
commit 14b47a929f
4 changed files with 27 additions and 2 deletions

View File

@@ -98,6 +98,11 @@ module.exports = {
if (newOpened.disconnected) return;
this.close(conid, false);
});
subprocess.on('error', err => {
logger.error(extractErrorLogData(err), 'Error in server connection subprocess');
if (newOpened.disconnected) return;
this.close(conid, false);
});
subprocess.send({ msgtype: 'connect', ...connection, globalSettings: await config.getSettings() });
return newOpened;
});