From 3b1b9a0bfb166e94d5690ee72c5f79f7d4d23dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 14 Oct 2021 16:50:14 +0200 Subject: [PATCH] common.sh: Adjust formatting in msg_on_error() and add stack trace --- scripts/common.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index 6d70a0840..da5b2d2ef 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -138,24 +138,30 @@ function msg_on_error() rm "$stdout_file" "$stderr_file" return 0 else - printError "Command failed: $SOLC ${command[*]}" + printError "" + printError "Command failed: ${error_message}" + printError " command: $SOLC ${command[*]}" if [[ -s "$stdout_file" ]] then - printError "stdout:" + printError "--- stdout ---" + printError "-----------" >&2 cat "$stdout_file" + printError "--------------" else - printError "stdout: " + printError " stdout: " fi if [[ -s "$stderr_file" ]] then - printError "stderr:" + printError "--- stderr ---" >&2 cat "$stderr_file" + printError "--------------" else - printError "stderr: " + printError " stderr: " fi - printError "$error_message" rm "$stdout_file" "$stderr_file" + + printStackTrace return 1 fi }