Skip to content

Commit

Permalink
fix: print full command in case of failure (#456)
Browse files Browse the repository at this point in the history
This is extremely useful for debugging when stderr is empty.
  • Loading branch information
Alicia Lopez committed Jul 14, 2020
1 parent 9bea4f3 commit a3e7db3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function runAsyncBase(cmd, args, options = {}) {
if (ignoreFailure) {
return reject(new Error(IGNORE));
}
const err = new Error(`${cmd} failed: ${code}`);
const err = new Error(`${cmd} ${args} failed: ${code}`);
err.code = code;
err.messageOnly = true;
return reject(err);
Expand Down Expand Up @@ -57,7 +57,8 @@ exports.runSync = function(cmd, args, options) {
if (child.error) {
throw child.error;
} else if (child.status !== 0) {
throw new Error(child.stderr.toString());
throw new Error(`${cmd} ${args} failed with stderr: ` +
child.stderr.toString());
} else {
return child.stdout.toString();
}
Expand Down

0 comments on commit a3e7db3

Please sign in to comment.