TIL: Getting decent error reports in Bash when you're using 'set -e'

The Bash trick you need is:

trap 'echo "Exit status $? at line $LINENO from: $BASH_COMMAND"' ERR

(via)