recoverIf

inline fun <V, E> Result<V, E>.recoverIf(predicate: (E) -> Boolean, transform: (E) -> V): Result<V, E>

Returns the transformation of the error if this Result is Err and satisfies the given predicate, otherwise this Result.