mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-28 01:01:12 +00:00
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`.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
_ERR() {
|
||||
error "Command $BASH_COMMAND failed (exit status: $?)"
|
||||
}
|
||||
set -e
|
||||
set -eE
|
||||
trap _ERR ERR
|
||||
|
||||
die() {
|
||||
|
||||
Reference in New Issue
Block a user