The problem actually has more to do with the definition of $? than the set -e behavior itself. And the fact that POSIX specifies that the error a the LHS of && is ignored (a fundamental confusion between true/false and success/error)
The exit code of the function is not what you expect, or the exit code of the subshell is not what you expect.
I made a note of it on the bug ... still thinking about what the solution to that one is.
(The other solutions are inherit_errexit, more_errexit, and a "catch" builtin.)
https://news.ycombinator.com/item?id=24740842
The problem actually has more to do with the definition of $? than the set -e behavior itself. And the fact that POSIX specifies that the error a the LHS of && is ignored (a fundamental confusion between true/false and success/error)
The exit code of the function is not what you expect, or the exit code of the subshell is not what you expect.
I made a note of it on the bug ... still thinking about what the solution to that one is.
(The other solutions are inherit_errexit, more_errexit, and a "catch" builtin.)