Skip to content

Commit c91c334

Browse files
author
Frank Schmid
committed
Enhance error message
1 parent 7a9757d commit c91c334

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ class SpawnError extends Error {
5555
this.stdout = stdout;
5656
this.stderr = stderr;
5757
}
58+
59+
toString() {
60+
return `${this.message}\n${this.stderr}`;
61+
}
5862
}
5963

6064
/**
@@ -85,7 +89,7 @@ function spawnProcess(command, args, options) {
8589
});
8690
child.on('close', exitCode => {
8791
if (exitCode !== 0) {
88-
reject(new SpawnError(`${command} failed with code ${exitCode}`, stdout, stderr));
92+
reject(new SpawnError(`${command} ${_.join(args, ' ')} failed with code ${exitCode}`, stdout, stderr));
8993
} else {
9094
resolve({ stdout, stderr });
9195
}

0 commit comments

Comments
 (0)