onError

inline fun onError(action: (E) -> Unit): Result<T, E>

Runs action only on error and returns this result unchanged. Action exceptions propagate.