Failure

sealed class Failure<out E : Any> : ApiResult<Nothing, E>

Types

Link copied to clipboard
class HttpFailure<E : Any> : ApiResult.Failure<E>

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

Link copied to clipboard
data class NetworkFailure : ApiResult.Failure<Nothing>

A failure due to a network problem given by error. The error could be from a number of different sources, e.g. connectivity

Link copied to clipboard
class UnknownFailure : ApiResult.Failure<Nothing>

An unknown error, given by error

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

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard