From 5be2182fef2676392bc8c71ce1c8e8dd9c9374a3 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 27 May 2021 11:47:02 +0100 Subject: [PATCH] piping errors to stderr when timeout exceeded --- packages/server/src/automations/steps/bash.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/server/src/automations/steps/bash.js b/packages/server/src/automations/steps/bash.js index e71c70368b..eb7ce605d2 100644 --- a/packages/server/src/automations/steps/bash.js +++ b/packages/server/src/automations/steps/bash.js @@ -42,7 +42,14 @@ module.exports.run = async function ({ inputs, context }) { try { const command = processStringSync(inputs.code, context) - const stdout = execSync(command, { timeout: 1000 }) + + let stdout + try { + stdout = execSync(command, { timeout: 500 }) + } catch (err) { + stdout = err.message + } + return { stdout, }