Add status code to error on Windows and macOS

This commit is contained in:
Joran Dirk Greef 2017-03-15 16:50:30 +02:00
parent a9f1a9e58e
commit 810e87f9ba

View file

@ -326,7 +326,10 @@ function MacResult(instance, end) {
if (code === 0) {
end(undefined, stdout, stderr);
} else {
error = new Error('Command failed: ' + instance.command);
error = new Error(
'Command failed: ' + instance.command + '\n' + stderr
);
error.code = code;
end(error, stdout, stderr);
}
}
@ -489,7 +492,10 @@ function WindowsResult(instance, end) {
if (code === 0) {
end(undefined, stdout, stderr);
} else {
error = new Error('Command failed: ' + instance.command);
error = new Error(
'Command failed: ' + instance.command + '\r\n' + stderr
);
error.code = code;
end(error, stdout, stderr);
}
}