ServiceError

public enum ServiceError : Error

Errors from the API or from the decoding of the responses.

  • Bad Request (HTTP status code 400). The request is invalid and cannot be accepted.

    Declaration

    Swift

    case badRequest(ErrorResponse)
  • Unauthorized (HTTP status code 401).

    Declaration

    Swift

    case unauthorized(ErrorResponse)
  • Forbidden (HTTP status code 403). The request is not allowed. This can happen if your API key is revoked, your token is incorrectly formatted, or if the requested operation is not allowed.

    Declaration

    Swift

    case forbidden(ErrorResponse)
  • Not Found (HTTP status code 404). The request cannot be fulfilled because the resource does not exist.

    Declaration

    Swift

    case notFound(ErrorResponse)
  • Conflict (HTTP status code 409). The provided resource data is not valid.

    Declaration

    Swift

    case conflict(ErrorResponse)
  • Unprocessable Entity (HTTP status code 422). The entity in the request body is invalid.

    Declaration

    Swift

    case unprocessableEntity(ErrorResponse)
  • The date in the response has an unknown format.

    Declaration

    Swift

    case wrongDateFormat(dateString: String)
  • The error is unhandled HTTP error.

    Declaration

    Swift

    case unknownHTTPError(statusCode: Int, data: Data)
  • The error is unknown.

    Declaration

    Swift

    case unknown(data: Data?)
  • The associated ErrorResponse if the error has one.

    Declaration

    Swift

    public var errorResponse: ErrorResponse? { get }
  • A human readable description of the error.

    Declaration

    Swift

    public var description: String? { get }