Fail statement

The fail statement terminates the execution of a function with a failure and sets its failure result.
Any deferred statements registered by the function will then be executed in reverse order, which may alter the function's result.
Note that unlike success results, a function can only have zero or one failure result.
Instead of capturing the error, as a shorthand it can be simply passed on using a question mark ? after the call.
Example of defer statement modifying the failure result.
It is invalid to use the fail statement in a function with no failure result.