ResponseErrorReason
public enum ResponseErrorReason
The possible underlying reasons a .responseFailed
error occurs.
- URLSessionError: An error occurred in the underlying
URLSession
object. Code 2001. - nonHTTPURLResponse: The response is not a valid
HTTPURLResponse
object. Code 2002. - dataParsingFailed: The received data cannot be parsed to an instance of the target type. Code 2003.
- invalidHTTPStatusAPIError: The received response contains an invalid HTTP status code. Code 2004.
-
Error details for
See moreinvalidHTTPStatusAPIError
. WhenResponseErrorReason
isinvalidHTTPStatusAPIError
,APIErrorDetail
is the associated value. It contains the HTTP status code and the error messages returned by the LINE server.Declaration
Swift
public struct APIErrorDetail
-
An error occurred in the underlying
URLSession
object. Code 2001.Declaration
Swift
case URLSessionError(Error)
-
The response is not a valid
HTTPURLResponse
object. Code 2002.Declaration
Swift
case nonHTTPURLResponse
-
The received data cannot be parsed to an instance of the target type. Code 2003.
- Associated values: Parsing destination type, original data, and system underlying error.
Declaration
Swift
case dataParsingFailed(Any.Type, Data, Error?)
-
The received response contains an invalid HTTP status code. Code 2004.
The associated value
APIErrorDetail
contains error details.Declaration
Swift
case invalidHTTPStatusAPIError(detail: APIErrorDetail)