onFailure

inline fun <T> Result<T>.onFailure(action: (exception: Throwable) -> Unit): Result<T>(source)

Performs the given action on the encapsulated Throwable exception if this instance represents failure. Returns the original Result unchanged.

Since Kotlin

1.3