0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00

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: https://github.com/nodejs/node/pull/19541
Fixes: https://github.com/nodejs/node/issues/19494
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
TomCoded 2018-03-22 21:11:28 +00:00 committed by Vse Mozhet Byt
parent d1720bddf4
commit 43506f1013

View File

@ -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