onError

fun onError(action: (Throwable) -> Unit): Response<T>

Executes the given action if this is an Error response.

Return

This response for chaining.

Parameters

action

The function to execute with the exception.