ResponseErrorReason
public enum ResponseErrorReason
Represents the error reason during networking response phase.
- invalidURLResponse: The response is not a valid URL response. Code 2001.
- invalidHTTPStatusCode: The response contains an invalid HTTP status code. Code 2002.
- URLSessionError: An error happens in the system URL session. Code 2003.
- dataModifyingFailed: Data modifying fails on returning a valid data. Code 2004.
- noURLResponse: The task is done but no URL response found. Code 2005.
-
The response is not a valid URL response. Code 2001.
- response: The received invalid URL response. The response is expected to be an HTTP response, but it is not.
Declaration
Swift
case invalidURLResponse(response: URLResponse)
-
The response contains an invalid HTTP status code. Code 2002.
Note
By default, status code 200..<400 is recognized as valid. You can override this behavior by conforming to theImageDownloaderDelegate
.- response: The received response.
Declaration
Swift
case invalidHTTPStatusCode(response: HTTPURLResponse)
-
An error happens in the system URL session. Code 2003.
- error: The underlying URLSession error object.
Declaration
Swift
case URLSessionError(error: Error)
-
Data modifying fails on returning a valid data. Code 2004.
- task: The failed task.
Declaration
Swift
case dataModifyingFailed(task: SessionDataTask)
-
The task is done but no URL response found. Code 2005.
- task: The failed task.
Declaration
Swift
case noURLResponse(task: SessionDataTask)