Stay organized with collections Save and categorize content based on your preferences.

ErrorRecovery

public enum ErrorRecovery extends Enum


The method of recovery when PagingSource returns LoadResult.Error. The error is indicated when PagingDataDiffer.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 Throwable that was caught when loading from the data source.

Public methods

final @NonNull ErrorRecovery

Returns the enum constant of this type with the specified name.

final @NonNull ErrorRecovery[]

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

RETRY

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

ErrorRecovery ErrorRecovery.RETURN_CURRENT_SNAPSHOT

Returns a snapshot with any data that has been loaded up till the point of error.

THROW

ErrorRecovery ErrorRecovery.THROW

Rethrow the original Throwable that was caught when loading from the data source.

Public methods

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 kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

public final @NonNull ErrorRecovery[] values()

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.