onError

open fun onError(block: (E) -> Unit): KthResult<T, E>

Executes a block of code when the result is Error, otherwise does nothing.

Parameters

block

The block to execute.