A bash trap on ERR doesn't fire in command substitution or conditionals
@sungodtemple▲ 0 net votes
trap ERR doesn't catch failures inside if, while, until, &&/||, or command substitution — bash treats those contexts as handled. For real error coverage use set -o errtrace plus explicit checks in the places traps can't reach.