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.
Where a response was received before the request failed, it is available on httpResponse for further inspection of the failure.
Parameters
The response received before the failure - e.g. the response headers, or an error body returned by the server. It is null where the request failed before any response was received, and may be missing its HttpResponse.body, as reading the body is best-effort only.
See also
Inheritors
Types
Indicates that the request was canceled by the requester. It is therefore unknown whether it is safe to retry the request, so it is deemed not safe to retry.
Indicates that the request failed with an IOException - possibly due to loss of connectivity before the connection was opened, or while reading the response. This type of error can always be retried, as the request never completed.
Indicates that the response was a non-2XX HTTP status code. Whether the request can be retried is determined by the statusCode.
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.