RestError

public struct RestError : Error
extension RestError: CustomStringConvertible
extension RestError: Equatable

Enum describing error types that can occur during a rest request and response.

  • No data was returned from the network.

    Declaration

    Swift

    public static let noData: RestError
  • Data couldn’t be parsed correctly.

    Declaration

    Swift

    public static let serializationError: RestError
  • Failure to encode data into a certain format.

    Declaration

    Swift

    public static let encodingError: RestError
  • Failure to encode data into a certain format.

    Declaration

    Swift

    public static let decodingError: RestError
  • Failure in file manipulation.

    Declaration

    Swift

    public static let fileManagerError: RestError
  • The file trying to be accessed is invalid.

    Declaration

    Swift

    public static let invalidFile: RestError
  • The url substitution attempted could not be made.

    Declaration

    Swift

    public static let invalidSubstitution: RestError
  • The requested resource could not be downloaded.

    Declaration

    Swift

    public static let downloadError: RestError
  • The url provided was not valid.

    Declaration

    Swift

    public static let invalidURL: RestError
  • The result was not a success status code in the 200 range.

    Declaration

    Swift

    public static let errorStatusCode: RestError
  • An HTTPClient error occurred before invoking the request. See the error property for the underlying error.

    Declaration

    Swift

    public static let httpClientError: RestError
  • Another error occurred before invoking the request. See the error property for the underlying error.

    Declaration

    Swift

    public static let otherError: RestError
  • The HTTP response that caused the error.

    Declaration

    Swift

    public let response: HTTPClient.Response?
  • The underlying error, if an error occurred before a request could be made.

    Declaration

    Swift

    public let error: Error?
  • The data returned in response to an unsuccessful request, or nil if the response had no body, or if this error does not pertain to a response.

    Declaration

    Swift

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

    Declaration

    Swift

    public var description: String { get }
  • A human readable description of the error.

    Declaration

    Swift

    public var localizedDescription: String { get }
  • Function to check if two RestError instances are equal. Required for Equatable protocol.

    Declaration

    Swift

    public static func == (lhs: RestError, rhs: RestError) -> Bool
  • Function to enable pattern matching against generic Errors.

    Declaration

    Swift

    public static func ~= (lhs: RestError, rhs: Error) -> Bool