Non-zero exit codes reject promise with a detailed message

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-07-12 12:07:23 -07:00
parent 1331cfb749
commit 0d35d5613a

View File

@@ -15,9 +15,7 @@ class ChildProccess
$native.exec command, options, (exitStatus, stdout, stderr) ->
if exitStatus != 0
error = new Error("Exec failed (#{exitStatus}) command '#{command}'")
error.exitStatus = exitStatus
deferred.reject(error)
deferred.reject("Command '#{command}' failed with exit status #{exitStatus} and stderr '#{stderr}'")
else
deferred.resolve(stdout, stderr)