Skip to content

Commit

Permalink
fixes #235 - any errors executing the commands are thrown as exceptio…
Browse files Browse the repository at this point in the history
…ns. Now they are propagated to the command handler.
  • Loading branch information
m-mcgowan committed Feb 6, 2017
1 parent 0a8a118 commit 192b907
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands/WirelessCommand/connect/darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function runCommand(cmd, args, cb) {
stderr += data;
});

s.on('error', function(err) {
cb(err, stdout, stderr);
});

s.on('close', function (code) {
cb(code, stdout, stderr);
});
Expand Down
4 changes: 4 additions & 0 deletions commands/WirelessCommand/connect/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function runCommand(cmd, args, cb) {
stderr += data;
});

s.on('error', function (error) {
cb(error, stdout, stderr);
});

s.on('close', function (code) {
cb(code, stdout, stderr);
});
Expand Down

0 comments on commit 192b907

Please sign in to comment.