From b818a38307dde52768fc95460d432d5f0a88f011 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Thu, 1 Mar 2018 13:56:08 -0600 Subject: [PATCH] Correctly report errors happening in functions `trap ... ERR` does not automatically propagate to functions. Therefore, Our fancy error-reporting mechanism did not catch errors happening in functions; and we do most of the actual work in functions. The solution is to `set -E` or `set -o errtrace`. --- prepare-vms/lib/cli.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare-vms/lib/cli.sh b/prepare-vms/lib/cli.sh index b20e6c8c..682c121b 100644 --- a/prepare-vms/lib/cli.sh +++ b/prepare-vms/lib/cli.sh @@ -2,7 +2,7 @@ _ERR() { error "Command $BASH_COMMAND failed (exit status: $?)" } -set -e +set -eE trap _ERR ERR die() {