LoadErrorHandler
-
Cmn
@VisibleForTesting
fun interface LoadErrorHandler
An interface to implement the error recovery strategy when PagingSource
returns a LoadResult.Error
.
Summary
Public functions |
||
---|---|---|
ErrorRecovery |
onError(combinedLoadStates: CombinedLoadStates) The lambda that should return an |
Cmn
|
Public functions
onError
fun onError(combinedLoadStates: CombinedLoadStates): ErrorRecovery
The lambda that should return an ErrorRecovery
given the CombinedLoadStates
indicating which LoadState
contains the LoadState.Error
.
Sample use case: val onError = LoadErrorHandler { combinedLoadStates -> if (combinedLoadStates.refresh is LoadResult.Error) { ErrorRecovery.RETRY } else { ErrorRecovery.THROW } }