mapFailure

inline fun <T> KotlinResult<T>.mapFailure(transform: (Throwable) -> Throwable): KotlinResult<T>

Transforms the encapsulated Throwable if this instance represents failure.

Successes pass through unchanged. Any exception thrown by transform propagates directly — it is not caught.

See also