HTTPError

public enum HTTPError: Error

Defines the various HttpErrors that can be received from an RestableCompletionHandler.

  • No response was returned from the server

    Declaration

    Swift

    case noResponse,
  • The URLResponse is not of the expected type

    Declaration

    Swift

    unexpectedResponse(URLResponse, Data?),
  • The HTTPURLResponse has a status code other than 2xx

    Declaration

    Swift

    unsuccessfulResponse(HTTPURLResponse, Data?),
  • The returned data cannot be deserialized into the expected type

    Declaration

    Swift

    unableToDeserializeJSON(error: Error, data: Data?),
  • Some other non-HttpError is raised.

    Declaration

    Swift

    other(Error, Data?)
  • Determines if 2 HttpErrors are roughly equal. Roughly equal because some enum values, such as .unableToDeserializeJSON, cannot be accurately truely identified as Equal because of their underlying values. As a result, the following enum values will always return true if they are the same at superficial level:

    • .unableToDeserializeJSON
    • .other

    Declaration

    Swift

    public static func ==(lhs: HTTPError, rhs: HTTPError) -> Bool

    Parameters

    lhs

    The HttpError

    rhs

    The other HttpError

    Return Value

    True if the 2 protocols are roughly equal; otherwise false.