Skip to content

Commit 9a8d271

Browse files
committed
exit immediately if error in executing local command
1 parent 5528a26 commit 9a8d271

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/local.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var Tunnel = function Tunnel(key, port, uniqueIdentifier, callback, err) {
2626
var subProcess = exec(tunnelCommand, function(error, stdout, stderr) {
2727
console.log(stderr);
2828
console.log(error);
29-
if (stdout.indexOf('Error') >= 0) {
29+
if (stdout.indexOf('Error') >= 0 || error) {
3030
console.log("[%s] Tunnel launching failed", new Date());
3131
console.log(stdout);
3232
process.exit(1);
@@ -78,6 +78,9 @@ var Tunnel = function Tunnel(key, port, uniqueIdentifier, callback, err) {
7878
setTimeout(function() {
7979
tunnelLauncher();
8080
}, 100);
81+
}).on('error', function(e) {
82+
console.log("Got error while downloading binary: " + e.message);
83+
process.exit(1);
8184
});
8285
});
8386
});

0 commit comments

Comments
 (0)