handle errors when sending to subprocess #458

This commit is contained in:
Jan Prochazka
2023-01-23 19:28:05 +01:00
parent d60687485b
commit 80e8b210be
5 changed files with 66 additions and 13 deletions

View File

@@ -33,11 +33,15 @@ function callForwardProcess(connection, tunnelConfig, tunnelCacheKey) {
);
pipeForkLogs(subprocess);
subprocess.send({
msgtype: 'connect',
connection,
tunnelConfig,
});
try {
subprocess.send({
msgtype: 'connect',
connection,
tunnelConfig,
});
} catch (err) {
logger.error({ err }, 'Error connecting SSH');
}
return new Promise((resolve, reject) => {
subprocess.on('message', resp => {
// @ts-ignore