But you really should know that set -e is broken.
FWIW, the bug (yes, it's a bug that the Open Group has decided is not a bug, but it really cannot be anything other than a bug!) is this: non-zero exits by commands/functions are ignored when invoked by functions invoked in a conditional expression context.