throwUnless

inline fun <V, E : Throwable> Result<V, E>.throwUnless(predicate: (E) -> Boolean): Result<V, E>

Throws the error if this Result is an Err and does not satisfy the given predicate, otherwise returns this Result.

See also