onFailure

inline fun <T> HubPayload<T>.onFailure(action: (error: ErrorPayload) -> Unit): HubPayload<T>

Performs the given action on the encapsulated ErrorPayload if this instance represents failure. Returns the original HubPayload unchanged.