reporting SSH tunnel errors

This commit is contained in:
Jan Prochazka
2024-10-23 16:35:56 +02:00
parent 3b82679c2d
commit 14501a70b9
3 changed files with 7 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ function callForwardProcess(connection, tunnelConfig, tunnelCacheKey) {
resolve(subprocess);
}
if (msgtype == 'error') {
reject(errorMessage);
reject(new Error(errorMessage));
}
});
subprocess.on('exit', code => {
@@ -91,6 +91,7 @@ async function getSshTunnel(connection) {
};
return sshTunnelCache[tunnelCacheKey];
} catch (err) {
logger.error(extractErrorLogData(err), 'Error creating SSH tunnel:');
// error is not cached
return {
state: 'error',