Failure

sealed class Failure<out F> : NetworkEither<F, Nothing>

Inheritors

Types

Link copied to clipboard
data class Http<out F>(val error: F, val code: Int, val headers: Headers) : NetworkEither.Failure<F>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class Unknown(val throwable: Throwable) : NetworkEither.Failure<Nothing>

Functions

Link copied to clipboard
inline fun <A> fold(failure: () -> A, success: (Nothing) -> A): A
inline fun <A> fold(httpFailure: (NetworkEither.Failure.Http<F>) -> A, localFailure: () -> A, remoteFailure: () -> A, unknownFailure: (Throwable) -> A, success: (NetworkEither.Success<Nothing>) -> A): A
Link copied to clipboard
@JvmName(name = "getCode1")
fun getCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "getThrowable1")
fun getThrowable(): Throwable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun ifFailureLocal(block: () -> Unit)
Link copied to clipboard
fun ifFailureRemote(block: () -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <L, R> toEither(crossinline httpFailure: (NetworkEither.Failure.Http<F>) -> L, localFailure: () -> L, remoteFailure: () -> L, crossinline unknownFailure: (Throwable) -> L, crossinline success: (NetworkEither.Success<Nothing>) -> R): Either<L, R>