throwIf

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

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

See also