RequestError
struct RequestError : RawRepresentable, Equatable, Hashable, Comparable, Error, CustomStringConvertible
An extension to Kitura RequestErrors with additional error codes specifically for the client.
-
An initializer to set up the client error codes.
Declaration
Swift
public init(clientErrorCode: Int, clientErrorDescription: String)
Parameters
clientErrorCode
The custom error code for the client.
-
An HTTP 600 unknown error
Declaration
Swift
public static var clientErrorUnknown: RequestError
-
An HTTP 601 connection error
Declaration
Swift
public static var clientConnectionError: RequestError
-
An HTTP 602 no data error
Declaration
Swift
public static var clientNoData: RequestError
-
An HTTP 603 serialization error
Declaration
Swift
public static var clientSerializationError: RequestError
-
An HTTP 604 deserialization error
Declaration
Swift
public static var clientDeserializationError: RequestError
-
An HTTP 605 encoding error
Declaration
Swift
public static var clientEncodingError: RequestError
-
An HTTP 606 file manager error
Declaration
Swift
public static var clientFileManagerError: RequestError
-
An HTTP 607 invalid file error
Declaration
Swift
public static var clientInvalidFile: RequestError
-
An HTTP 608 invalid substitution error
Declaration
Swift
public static var clientInvalidSubstitution: RequestError
-
An initializer to switch between different error types.
Declaration
Swift
public init(restError: RestError)
Parameters
restError
The custom error type for the client.