Commit c06676f1 authored by Erik Schwartz's avatar Erik Schwartz 🉐
Browse files

Separate connection from emit events

parent 7c4747e0
......@@ -51,11 +51,12 @@ function downloadFile(sshOpt, remoteFile, localFile, callback) {
});
});
});
}).connect(sshOpt);
});
ssh.on('error', (err) => {
console.error('Problem connecting to SSH server');
return callback(err);
});
ssh.connect(sshOpt);
}
// -------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment