From f712774ee4c91c6ac2624703df5be5459b24cb92 Mon Sep 17 00:00:00 2001 From: TomCoded Date: Thu, 22 Mar 2018 21:11:28 +0000 Subject: [PATCH 1/2] doc: clarify child_process.exec promise rejection on non-zero exit Promisify section of child_process.exec doc changed to make clear that non-zero exit codes will result in promise rejection. fixes: https://github.com/nodejs/node/issues/19494 --- doc/api/child_process.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 57a0f9296a46d9..0c0b35495d7a4c 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -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'); From f47c3bce5eeb55d150b2214c81fb1d4be3e8f44d Mon Sep 17 00:00:00 2001 From: TomCoded Date: Thu, 22 Mar 2018 22:34:19 +0000 Subject: [PATCH 2/2] doc: clarify child_process.execFile promise rejection on non-zero exit Promisify section of child_process.execFile doc changed to make clear that non-zero exit codes will result in promise rejection. fixes: https://github.com/nodejs/node/issues/19494 --- doc/api/child_process.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 0c0b35495d7a4c..4f8089ccc72a40 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -302,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