replace If Failure
Replaces a failed Result with a new value computed from the exception. If this Result is successful, it is returned as-is. If it represents a failure, the onException handler is called with the exception to compute a replacement value, which is then wrapped in a new Result.
Return
The original Result if successful, or a new Result containing the replacement value
Parameters
on Exception
A function that computes a replacement value from the caught exception
Type Parameters
T
The type of the successful value