From 5b91a90c34a85f4f651d1f0436fb08f2f5d82c7c Mon Sep 17 00:00:00 2001 From: Andrei Zhemaituk Date: Wed, 23 Feb 2022 18:24:55 -0500 Subject: [PATCH] Print out child process command output on error #663 A small addition to print out actual error details on child process failure. Refer to #663 for issues details, when build fail for one or another reason, usually connected to configuration error and not library error, but no details are printed out. --- lib/pip.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/pip.js b/lib/pip.js index 7a0a0ceb..79dec42a 100644 --- a/lib/pip.js +++ b/lib/pip.js @@ -415,6 +415,13 @@ async function installRequirements(targetFolder, pluginInstance) { 'PYTHON_REQUIREMENTS_COMMAND_NOT_FOUND' ); } + if (log) { + log.info(`Stdout: ${e.stdoutBuffer}`); + log.info(`Stderr: ${e.stderrBuffer}`); + } else { + serverless.cli.log(`Stdout: ${e.stdoutBuffer}`); + serverless.cli.log(`Stderr: ${e.stderrBuffer}`); + } throw e; } }