retrofit / retrofit2 / Callback / onFailure

onFailure

abstract fun onFailure(call: Call<T>!, t: Throwable!): Unit

Invoked when a network exception occurred talking to the server or when an unexpected exception occurred creating the request or processing the response.