I tend to avoid `set -e`. To borrow the Python adage: "explicit is better than implicit". In shell it translates to "if you need error handling, add it where necessary".
See http://mywiki.wooledge.org/BashFAQ/105 for some (most) of the pitfalls.
See http://mywiki.wooledge.org/BashFAQ/105 for some (most) of the pitfalls.
Or consider the last example from the wiki link above:
set -e
f() { local var=$(somecommand that fails); }
f # will not exit $ ( set -e; foo() { f=$(false); }; foo ; ); echo $?
1
$ ( set -e; foo() { local f=$(false); }; foo ; ); echo $?
0
$ ( set -e; foo() { local f; f=$(false); }; foo ; ); echo $?
1
However, it is still better to use -e to catch errors early.