APIError
public enum APIError : Swift.Error
extension APIError: LocalizedError
extension APIError: ErrorConvertible, ErrorWithCause
An error from data store
-
Indicates that JSON data for one page is not decodable.
Declaration
Swift
case jsonMappingFailed(JSON, Any.Type) -
Indicates that JSON data have incoherence and records could not be decoded.
Declaration
Swift
case recordsDecodingFailed(JSON, ImportableParser.Error) -
Indicates a response failed due to an underlying
Error.Declaration
Swift
case request(Swift.Error) -
Indicates a json decoding process due to an underlying
Error.Declaration
Swift
case jsonDecodingFailed(Swift.Error) -
Indicates a string decoding process due to an underlying
Error.Declaration
Swift
case stringDecodingFailed(Swift.Error) -
Return true if error correspond to the pass HTTP code.
Declaration
Swift
public func isHTTPResponseWith(code: HTTPCode) -> Bool -
Return true if error correospond to one of passed HTTP codes.
Declaration
Swift
public func isHTTPResponseWith(codes: [HTTPCode]) -> Bool -
Return
trueif one of underlying error is anURLError.Declaration
Swift
public var isUrlError: Bool { get } -
Return the underlying error if its an
URLError.Declaration
Swift
public var urlError: URLError? { get } -
Check if contains the specifyed error code.
Declaration
Swift
public func isUrlError(with code: URLError.Code) -> BoolParameters
codethe code
Return Value
trueif this error contains the code. -
Check if contains the specifyed one the specifyed error code.
Declaration
Swift
public func isUrlError(with codes: [URLError.Code]) -> BoolParameters
codesthe codes to check
Return Value
trueif this error contains one of the codes. -
Is
.timedOuterror.Declaration
Swift
public var isTimedOut: Bool { get } -
Is
.cannotConnectToHosterror.Declaration
Swift
public var isCannotConnectToHost: Bool { get } -
Is
.notConnectedToInterneterror.Declaration
Swift
public var isNotConnectedToInternet: Bool { get } -
Is
.cancellederror.Declaration
Swift
public var isCancelled: Bool { get } -
Is
.userAuthenticationRequirederror.Declaration
Swift
public var isUserAuthenticationRequired: Bool { get } -
Undocumented
See moreDeclaration
Swift
public enum RequestCase : String -
Check if this error match the request case.
Declaration
Swift
public func isRequestCase(_ case: RequestCase) -> BoolParameters
casethe request case to check
Return Value
trueif error match the request case -
the underlying request case if any.
Declaration
Swift
public var requestCase: RequestCase? { get } -
The localized error description.
Declaration
Swift
public var errorDescription: String? { get } -
Declaration
Swift
public var failureReason: String? { get } -
Declaration
Swift
public var recoverySuggestion: String? { get } -
Declaration
Swift
public var helpAnchor: String? { get } -
Undocumented
Declaration
Swift
public static func error(from underlying: Swift.Error) -> APIError -
The underlying error if any.
Declaration
Swift
public var error: Swift.Error? { get } -
The underlying response if any.
Declaration
Swift
public var response: Response? { get } -
The underlying
MoyaErrorfrom Moya api if any.Declaration
Swift
public var moyaError: MoyaError? { get } -
The underlying
AFErrorfrom Alamofire if any.Declaration
Swift
public var afError: AFError? { get } -
The underlying url if any.
Declaration
Swift
public var url: URL? { get } -
The underlying url as url convertible if any.
Declaration
Swift
public var urlConvertible: URLConvertible? { get } -
The server response as string if any.
Declaration
Swift
public var responseString: String? { get } -
Create
APIErrorfromMoyaErrorDeclaration
Swift
public static func moya(_ moyaError: MoyaError) -> APIError
-
trueif there is rest errors. If you need to know that and userestErrors, prefer userestErrorsdirectly.Declaration
Swift
public var isRestError: Bool { get } -
Get
RestErrorsfrom this error data.Declaration
Swift
public var restErrors: RestErrors? { get } -
Check if match rest error code.
Declaration
Swift
public func match(_ code: RestErrorCode) -> BoolParameters
codethe code to chec;
Return Value
trueif match
APIError Enumeration Reference