recover

inline suspend fun <T> Outcome<T>.recover(recoverBlock: suspend (Outcome.Failure) -> T): Outcome<T>

Recovers from a Failure by applying the recoverBlock function to produce a new value.

Return

The original Success, or a new Success with the recovered value.

Parameters

recoverBlock

The function to produce a value from a Failure.