diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-10-06 21:06:18 -0700 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-10-23 14:09:11 +0200 |
commit | 556ebab30e171c2941deb529a42ad47301972af5 (patch) | |
tree | c619a041b2a313bab5dbe422d9076b5df127d14e /lib/child_process.js | |
parent | 801e61ad5a4ee2e5621c2578a44c9d63c99c9ff6 (diff) | |
download | android-node-v8-556ebab30e171c2941deb529a42ad47301972af5.tar.gz android-node-v8-556ebab30e171c2941deb529a42ad47301972af5.tar.bz2 android-node-v8-556ebab30e171c2941deb529a42ad47301972af5.zip |
child_process: restore exec{File}Sync error props
In PR [1], a bunch of properties were removed from the error thrown by
execSync and execFileSync. It turns out that some of those were still
supposed to be there, as the documentation states that the error
contains the entire result from the spawnSync call.
[1] https://github.com/nodejs/node/pull/13601
PR-URL: https://github.com/nodejs/node/pull/16060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/child_process.js')
-rw-r--r-- | lib/child_process.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index d9e11cb9a7..a0bd01b16b 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -574,8 +574,7 @@ function checkExecSyncError(ret, args, cmd) { err = new Error(msg); } if (err) { - err.status = ret.status < 0 ? errname(ret.status) : ret.status; - err.signal = ret.signal; + Object.assign(err, ret); } return err; } |