GenericError

data class GenericError(val exception: Throwable, val humanReadableMessage: String, val exceptionMessage: String) : ApiResult.Error

Represent other exceptions.

Parameters

message

Detail exception message

exceptionMessage

Formatted error message

Constructors

Link copied to clipboard
constructor(exception: Throwable, humanReadableMessage: String, exceptionMessage: String)

Properties

Link copied to clipboard
open override val exception: Throwable

Raw exception that was thrown

Link copied to clipboard
open override val exceptionMessage: String
Link copied to clipboard
open override val humanReadableMessage: String

Human readable message for the error that can be displayed to users.

Functions

Link copied to clipboard
inline fun <T : Any> ApiResult<T>.getOrNull(): T?
Link copied to clipboard
inline fun <R : Any, T : Any> ApiResult<T>.map(transform: (value: T) -> R?): ApiResult<R>
Link copied to clipboard
inline fun <T : Any> ApiResult<T>.onError(block: (Throwable) -> Unit): ApiResult<T>
Link copied to clipboard
inline fun <T : Any> ApiResult<T>.onSuccess(block: (T) -> Unit): ApiResult<T>