NetworkException

Return type to signify that an error has occurred. The type returned indicates what type of error has occurred, and the isRetryable implementation will indicate if it is safe to retry the request.

See also

Inheritors

Types

Link copied to clipboard

Indicates that the request was cancelled by the requester. It is therefore unknown whether it is safe to retry the request, so it is deemed not safe to retry.

Link copied to clipboard

Indicates that a connection was not able to be made - possibly due to loss of connectivity prior to the connection being opened. This type of error can always be retried as no connection to the destination was ever made.

Link copied to clipboard
class Non200Exception(val statusCode: Int) : NetworkException

Indicates that the response was a non-2XX HTTP status code. Whether the request can be retried is determined by the statusCode.

Link copied to clipboard

Indicates that a network request failed for an unknown reason. It is therefore unknown whether it is safe to retry the request, so it is deemed not safe to retry.

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val message: String?

Functions

Link copied to clipboard
abstract fun isRetryable(): Boolean