onFailure

inline fun <T> ChannelResult<T>.onFailure(action: (exception: Throwable?) -> Unit): ChannelResult<T>

Performs the given action on the encapsulated Throwable exception if this instance represents failure. The result of ChannelResult.exceptionOrNull is passed to the action parameter.

Returns the original ChannelResult unchanged.

Sources

common source
Link copied to clipboard