failure

fun <T> failure(error: Throwable, errorUpdatedAt: Long = epoch()): QueryState<T>

Creates a new QueryState with the QueryStatus.Failure status.

Parameters

error

The error that occurred.

errorUpdatedAt

The timestamp when the error occurred. Default is the current epoch.


fun <T> failure(error: Throwable, errorUpdatedAt: Long = epoch(), data: T, dataUpdatedAt: Long = epoch(), dataStaleAt: Long = dataUpdatedAt): QueryState<T>

Creates a new QueryState with the QueryStatus.Failure status.

Parameters

error

The error that occurred.

errorUpdatedAt

The timestamp when the error occurred. Default is the current epoch.

data

The data to be stored in the state.

dataUpdatedAt

The timestamp when the data was updated. Default is the current epoch.

dataStaleAt

The timestamp after which data is considered stale. Default is the same as dataUpdatedAt.