HttpFailure

class HttpFailure<E : Any> : ApiResult.Failure<E>

A HTTP failure i.e. 4xx or 5xx, given by code.

Functions

Link copied to clipboard
fun getSuccessData(): Nothing

Get the data from a Success result. Throws if this result is a Failure

Link copied to clipboard
fun getSuccessDataOrNull(): Nothing?

Get the data from a Success result, or null if this result is a Failure

Link copied to clipboard
fun isSuccess(): Boolean

Is this result a Success

Properties

Link copied to clipboard
val code: Int

The HTTP error code

Link copied to clipboard
val error: E?

An optional typed error, giving more detail about the failure