HTTPError

public enum HTTPError : LocalizedError, CustomStringConvertible

Basic validation error

Initializers

  • Create an HTTPError based on a status code

    Declaration

    Swift

    public init?(_ code: Int)

    Parameters

    code

    The code

API

  • Bad request (400)

    Declaration

    Swift

    case badRequest
  • Authorization error (401)

    Declaration

    Swift

    case unauthorized
  • Forbidden error (403)

    Declaration

    Swift

    case forbidden
  • Not found error (404)

    Declaration

    Swift

    case notFound
  • Custom 4xx error

    Declaration

    Swift

    case error4xx(_: Int)
  • Server error (500)

    Declaration

    Swift

    case serverError
  • Custom 5xx error

    Declaration

    Swift

    case error5xx(_: Int)
  • Other http error

    Declaration

    Swift

    case unknownErrorCode(_: Int)

LocalizedError

  • Declaration

    Swift

    public var errorDescription: String? { get }

CustomStringConvertible

  • Declaration

    Swift

    public var description: String { get }