ErrorRecovery
@VisibleForTesting
public enum ErrorRecovery extends Enum
The method of recovery when PagingSource returns LoadResult.Error. The error is indicated when PagingDataPresenter.loadStateFlow emits a CombinedLoadStates where one or more of the LoadState is LoadState.Error.
Summary
Enum Values |
|
|---|---|
RETRY |
Retry the failed load. |
RETURN_CURRENT_SNAPSHOT |
Returns a snapshot with any data that has been loaded up till the point of error. |
THROW |
Rethrow the original |
Public methods |
|
|---|---|
final @NonNull EnumEntries<@NonNull ErrorRecovery> |
The method of recovery when |
final @NonNull ErrorRecovery |
Returns the enum constant of this type with the specified name. |
final @NonNull ErrorRecovery[] |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Enum Values
RETRY
@VisibleForTesting
ErrorRecovery ErrorRecovery.RETRY
Retry the failed load. This does not guarantee a successful load as the data source may still return an error.
RETURN_CURRENT_SNAPSHOT
@VisibleForTesting
ErrorRecovery ErrorRecovery.RETURN_CURRENT_SNAPSHOT
Returns a snapshot with any data that has been loaded up till the point of error.
THROW
@VisibleForTesting
ErrorRecovery ErrorRecovery.THROW
Rethrow the original Throwable that was caught when loading from the data source.
Public methods
getEntries
public final @NonNull EnumEntries<@NonNull ErrorRecovery> getEntries()
The method of recovery when PagingSource returns LoadResult.Error. The error is indicated when PagingDataPresenter.loadStateFlow emits a CombinedLoadStates where one or more of the LoadState is LoadState.Error.
valueOf
public final @NonNull ErrorRecovery valueOf(@NonNull String value)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if this enum type has no constant with the specified name |