Permalink
Browse files

doc: clarify child_process promise rejections

Promisify sections of `child_process.exec()`
and `child_process.execFile()` changed to make clear
that non-zero exit codes will result in promise rejection.

PR-URL: #19541
Fixes: #19494
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
TomCoded authored and vsemozhetbyt committed Mar 22, 2018
1 parent d1720bd commit 43506f1013c5568243dc800c42536d5aa72a3589
Showing with 5 additions and 3 deletions.
  1. +5 −3 doc/api/child_process.md
View
@@ -223,8 +223,9 @@ the existing process and uses a shell to execute the command.
If this method is invoked as its [`util.promisify()`][]ed version, it returns
a Promise for an object with `stdout` and `stderr` properties. In case of an
error, a rejected promise is returned, with the same `error` object given in the
callback, but with an additional two properties `stdout` and `stderr`.
error (including any error resulting in an exit code other than 0), a rejected
promise is returned, with the same `error` object given in the callback, but
with an additional two properties `stdout` and `stderr`.
```js
const util = require('util');
@@ -301,7 +302,8 @@ encoding, `Buffer` objects will be passed to the callback instead.
If this method is invoked as its [`util.promisify()`][]ed version, it returns
a Promise for an object with `stdout` and `stderr` properties. In case of an
error, a rejected promise is returned, with the same `error` object given in the
error (including any error resulting in an exit code other than 0), a rejected
promise is returned, with the same `error` object given in the
callback, but with an additional two properties `stdout` and `stderr`.
```js

0 comments on commit 43506f1

Please sign in to comment.