HTTPError
public enum HTTPError : LocalizedError, CustomStringConvertible
Basic validation error
-
Create an
HTTPError
based on a status codeDeclaration
Swift
public init?(_ code: Int)
Parameters
code
The code
-
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)
-
Declaration
Swift
public var errorDescription: String? { get }
-
Declaration
Swift
public var description: String { get }