Transform exception into some other Throwable.
Success ->returns the original caller.
returns
Failure ->wraps&returns the result of onFailure transformation.
Note, this function rethrows any Throwable exception thrown by the onFailure function.