Documentation / dataflow-async / com.femastudios.dataflow.async / Error
Go to reference

Error

open class Error<out T> : NotLoaded<T>

This class is one of the extensions of the NotLoaded status, and is used to represent a data whose loading di not succeed. It contains some data that can help inform the user. The class is open and can be extended to add custom data.

Parameters

displayableMessage - an error message

displayableDescription - a full description of the error

retry - a function that retries to load the data

Constructors

<init>

This class is one of the extensions of the NotLoaded status, and is used to represent a data whose loading di not succeed. It contains some data that can help inform the user. The class is open and can be extended to add custom data.

Error(displayableMessage: String?, displayableDescription: String?, retry: (() -> Unit)?)

Properties

displayableDescription

a full description of the error

val displayableDescription: String?

displayableMessage

an error message

val displayableMessage: String?

retry

a function that retries to load the data

val retry: (() -> Unit)?

Functions

asField

Returns a constant Field that contains this AttributeData

open fun asField(): Field<Error<T>>

cast

Performs a cast to a different type parameter, which is necessary to propagate a status between attributes of different type. For performance reasons it's better to cast the error rather than creating a new instance, and since most of the time the statuses extending NotLoaded do not make use of the type parameter T, it can be safely done.

open fun <O> cast(): Error<O>

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

merge

Merges this Error with the given list of errors. If customRetry is not null resulting error should have customRetry as retry callback.

open fun merge(errors: List<Error<T>>, customRetry: (() -> Unit)? = null): Error<T>

retry

Invokes the retry function, if it's not null

fun retry(): Unit

toString

open fun toString(): String