AFError
public enum AFError : Error
AFError is the error type returned by Alamofire. It encompasses a few different types of errors, each with
their own associated reasons.
-
The underlying reason the
See more.parameterEncodingFailederror occurred.Declaration
Swift
public enum ParameterEncodingFailureReason -
The underlying reason the
See more.parameterEncoderFailederror occurred.Declaration
Swift
public enum ParameterEncoderFailureReason -
The underlying reason the
See more.multipartEncodingFailederror occurred.Declaration
Swift
public enum MultipartEncodingFailureReason -
The underlying reason the
See more.responseValidationFailederror occurred.Declaration
Swift
public enum ResponseValidationFailureReason -
The underlying reason the response serialization error occurred.
See moreDeclaration
Swift
public enum ResponseSerializationFailureReason -
Underlying reason a server trust evaluation error occurred.
See moreDeclaration
Swift
public enum ServerTrustFailureReason -
Sessionwas explicitly invalidated, possibly with theErrorproduced by the underlyingURLSession.Declaration
Swift
case sessionInvalidated(error: Error?) -
Requestwas explcitly cancelled.Declaration
Swift
case explicitlyCancelled -
URLConvertibletype failed to create a validURL.Declaration
Swift
case invalidURL(url: URLConvertible) -
ParameterEncodingthrew an error during the encoding process.Declaration
Swift
case parameterEncodingFailed(reason: ParameterEncodingFailureReason) -
ParameterEncoderthrew an error while running the encoder.Declaration
Swift
case parameterEncoderFailed(reason: ParameterEncoderFailureReason) -
Multipart form encoding failed.
Declaration
Swift
case multipartEncodingFailed(reason: MultipartEncodingFailureReason) -
RequestAdapterfailed threw an error during adaptation.Declaration
Swift
case requestAdaptationFailed(error: Error) -
Response validation failed.
Declaration
Swift
case responseValidationFailed(reason: ResponseValidationFailureReason) -
Response serialization failued.
Declaration
Swift
case responseSerializationFailed(reason: ResponseSerializationFailureReason) -
ServerTrustEvaluatinginstance threw an error during trust evaluation.Declaration
Swift
case serverTrustEvaluationFailed(reason: ServerTrustFailureReason) -
RequestRetrierthrew an error during the request retry process.Declaration
Swift
case requestRetryFailed(retryError: Error, originalError: Error)
-
Returns whether the instance is
.sessionDeinitialized.Declaration
Swift
public var isSessionDeinitializedError: Bool { get } -
Returns whether the instance is
.sessionInvalidated.Declaration
Swift
public var isSessionInvalidatedError: Bool { get } -
Returns whether the instance is
.explicitlyCancelled.Declaration
Swift
public var isExplicitlyCancelledError: Bool { get } -
Returns whether the instance is
.invalidURL.Declaration
Swift
public var isInvalidURLError: Bool { get } -
Returns whether the instance is
.parameterEncodingFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isParameterEncodingError: Bool { get } -
Returns whether the instance is
.parameterEncoderFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isParameterEncoderError: Bool { get } -
Returns whether the instance is
.multipartEncodingFailed. Whentrue, theurlandunderlyingErrorproperties will contain the associated values.Declaration
Swift
public var isMultipartEncodingError: Bool { get } -
Returns whether the instance is
.requestAdaptationFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isRequestAdaptationError: Bool { get } -
Returns whether the instance is
.responseValidationFailed. Whentrue, theacceptableContentTypes,responseContentType, andresponseCodeproperties will contain the associated values.Declaration
Swift
public var isResponseValidationError: Bool { get } -
Returns whether the instance is
.responseSerializationFailed. Whentrue, thefailedStringEncodingandunderlyingErrorproperties will contain the associated values.Declaration
Swift
public var isResponseSerializationError: Bool { get } -
Returns whether the instance is
.serverTrustEvaluationFailed.Declaration
Swift
public var isServerTrustEvaluationError: Bool { get } -
Returns whether the instance is
requestRetryFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isRequestRetryError: Bool { get }
-
The
URLConvertibleassociated with the error.Declaration
Swift
public var urlConvertible: URLConvertible? { get } -
The
URLassociated with the error.Declaration
Swift
public var url: URL? { get } -
The underlying
Errorresponsible for generating the failure associated with.sessionInvalidated,.parameterEncodingFailed,.parameterEncoderFailed,.multipartEncodingFailed,.requestAdaptationFailed,.responseSerializationFailed,.requestRetryFailederrors.Declaration
Swift
public var underlyingError: Error? { get } -
The acceptable
Content-Types of a.responseValidationFailederror.Declaration
Swift
public var acceptableContentTypes: [String]? { get } -
The response
Content-Typeof a.responseValidationFailederror.Declaration
Swift
public var responseContentType: String? { get } -
The response code of a
.responseValidationFailederror.Declaration
Swift
public var responseCode: Int? { get } -
The
String.Encodingassociated with a failed.stringResponse()call.Declaration
Swift
public var failedStringEncoding: String.Encoding? { get }
-
Declaration
Swift
public var errorDescription: String? { get }
View on GitHub
Install in Dash
AFError Enumeration Reference