Failure

sealed class Failure<T> : ApiResponse<T>

Author

skydoves (Jaewoong Eum)

API Failure response class from OkHttp request call. There are two subtypes: ApiResponse.Failure.Error and ApiResponse.Failure.Exception.

Types

Link copied to clipboard
data class Error<T>(val response: Response<T>) : ApiResponse.Failure<T>

API response error case. API communication conventions do not match or applications need to handle errors. e.g., internal server error.

Link copied to clipboard
data class Exception<T>(val exception: Throwable) : ApiResponse.Failure<T>

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun <T> ApiResponse.Failure<T>.message(): String

Returns an error message from the ApiResponse.Failure that consists of the localized message.