APIotaClientError

public enum APIotaClientError<ErrorResponse> : LocalizedError where ErrorResponse : Decodable
extension APIotaClientError: Equatable

Describes the error states generated by APIotaClient.

The ErrorResponse type should match the associated type from an APIotaCodableEndpoint type.

  • The URLRequest could not be initialized with a valid URL.

    Declaration

    Swift

    case clientSide
  • The response body could not be decoded to the specified type.

    Declaration

    Swift

    case decodingError(_: DecodingError)
  • The request body could not be encoded to the specified type.

    Declaration

    Swift

    case encodingError(_: EncodingError)
  • The server returned a failed response indicated by a non-successful HTTPStatusCode.

    If the errorResponseBody cannot be decoded to the ErrorResponse type, the raw response body Data will be returned (or empty Data if there was no response body).

    Declaration

    Swift

    case failedResponse(statusCode: HTTPStatusCode, errorResponseBody: ErrorResponse)
  • An internal error occured.

    When the circumstances that caused the error cannot be determined, an internalError will be thrown.

    Declaration

    Swift

    case internalError(_: Error)
  • The server returned a response that was not a HTTPURLResponse.

    Declaration

    Swift

    case unexpectedResponse
  • A localized human-readable description of the error.

    Declaration

    Swift

    public var errorDescription: String? { get }

Equatable conformance

  • Returns a Boolean value indicating whether two APIotaClientError values are equal.

    Declaration

    Swift

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

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

    Return Value

    true if the two errors are considered equal, and false otherwise.