mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Reject exec promise with hash instead of string
This commit is contained in:
@@ -88,6 +88,7 @@ describe 'Child Processes', ->
|
||||
describe "when the command fails", ->
|
||||
it "executes the callback with error set to the exit status", ->
|
||||
waitsForPromise shouldReject: true, ->
|
||||
cmd = "exit 2"
|
||||
cmd = "echo 'bad' >&2 && exit 2"
|
||||
ChildProcess.exec(cmd).fail (error) ->
|
||||
expect(error.exitStatus).toBe 2
|
||||
expect(error.stderr).toBe "bad\n"
|
||||
|
||||
@@ -15,7 +15,7 @@ class ChildProccess
|
||||
|
||||
$native.exec command, options, (exitStatus, stdout, stderr) ->
|
||||
if exitStatus != 0
|
||||
deferred.reject("Command '#{command}' failed with exit status #{exitStatus} and stderr '#{stderr}'")
|
||||
deferred.reject({command, exitStatus, stderr})
|
||||
else
|
||||
deferred.resolve(stdout, stderr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user