If set, any trap on ERR is inherited by shell functions, command substitutions, and commands executed in a subshell environment. The ERR trap is normally not inherited in such cases.
See also
set, unset, set -o, set -x, set -e, set +e, set -E, set +b, set -u, $?, exit, return, trap, PostgreSQL SET