Error

public enum Error : Swift.Error, CustomDebugStringConvertible

Definitions for errors typically thrown by Zone5 methods.

  • An unknown error occurred.

    Declaration

    Swift

    case unknown
  • Invalid parameters passed to request

    Declaration

    Swift

    case invalidParameters
  • The Zone5 configuration is invalid. It is required that you call configure(for:clientID:clientSecret:) with your client details, which are included in calls to the Zone5 API.

    Declaration

    Swift

    case invalidConfiguration
  • A request body was provided to a request that doesn’t take a request body.

    Typically this means that the request itself is a HTTP GET request, whereas the request body suggests that the request is expected to be HTTP POST, and indicates an internal issue in the SDK.

    Declaration

    Swift

    case unexpectedRequestBody
  • A request body was not provided for a request that expects a request body.

    Typically this means that the request itself is a HTTP POST request, whereas the lack of a request body suggests that the request is expected to be HTTP GET, and indicates an internal issue in the SDK.

    Declaration

    Swift

    case missingRequestBody
  • An error occurred while encoding the request body.

    Declaration

    Swift

    case failedEncodingRequestBody
  • The Zone5 server returned an error.

    Declaration

    Swift

    case serverError(_: ServerMessage)

    Parameters

    message

    The error structure returned by the server.

  • An error occurred while decoding the server’s response.

    This wraps errors related to the decoder layer, and typically means that the server responded, but we weren’t able to convert the response to the expected object structure, and it was also not an error message (in which case, .serverError(_:) would be returned instead).

    Declaration

    Swift

    case failedDecodingResponse(_: Swift.Error)

    Parameters

    underlyingError

    The original error thrown while decoding the response.

  • The system produced an error while attempting to communicate with the API.

    This typically is the source for errors related to the communication layer, i.e. server timeouts, lack of internet connection, etc. For additional information, check the underlyingError.

    Declaration

    Swift

    case transportFailure(_: Swift.Error)

    Parameters

    underlyingError

    The original error thrown while attempting to communicate with the server.

  • Structure that represents a message produced by the server when an error occurs.

    See more

    Declaration

    Swift

    public struct ServerMessage : Swift.Error, Codable, Equatable
  • A textual description of the error, suitable for debugging.

    Declaration

    Swift

    public var debugDescription: String { get }