-e Exit immediately if a command exits with a non-zero status.
-x Print commands and their arguments as they are executed.
bash-3.2$ help set
Note, there’s an argument (in the SO post) that better practice is:
<span class="pln">trap </span><span class="str">'do_something'</span><span class="pln"> ERR</span>