Break up ternary in `with_exception_handling`.

Suggested by Zeriab; clarifies the flow of logic within the method.