toErrorIf

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

Returns the transformation of the value if this Result is Ok and satisfies the given predicate, otherwise this Result.

See also