Skip to content

child_process: exec's promisify impl now includes stdout/err in error

This converts the initial implementation of a promised exec that used the customPromisifyArgs support in util.promisify with a custom implementation. This is because exec and execFile, when there is an error, still supply the stdout and stderr of the process, and yet the promisified version with customPromisifyArgs does not supply this ability.

I created a custom implementation and attached it to exec and execFile using the util.promisify.custom key.

Note that I added stdout and stderr as regular enumerable properties. I'm not sure that's the right decision.

Fixes: https://github.com/nodejs/node/issues/13364

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

child_process

Merge request reports

Loading