AFError
public enum AFError : Error, Sendable
extension AFError: LocalizedError
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.multipartEncodingFailederror occurred.Declaration
Swift
public enum MultipartEncodingFailureReason : Sendable -
Represents unexpected input stream length that occur when encoding the
See moreMultipartFormData. Instances will be embedded within anAFError.multipartEncodingFailed.inputStreamReadFailedcase.Declaration
Swift
public struct UnexpectedInputStreamLength : Error -
The underlying reason the
See more.parameterEncodingFailederror occurred.Declaration
Swift
public enum ParameterEncodingFailureReason : Sendable -
The underlying reason the
See more.parameterEncoderFailederror occurred.Declaration
Swift
public enum ParameterEncoderFailureReason : Sendable -
The underlying reason the
See more.responseValidationFailederror occurred.Declaration
Swift
public enum ResponseValidationFailureReason : Sendable -
The underlying reason the response serialization error occurred.
See moreDeclaration
Swift
public enum ResponseSerializationFailureReason : Sendable -
Underlying reason a server trust evaluation error occurred.
See moreDeclaration
Swift
public enum ServerTrustFailureReason : Sendable -
The underlying reason the
See more.urlRequestValidationFailederror occurred.Declaration
Swift
public enum URLRequestValidationFailureReason : Sendable -
UploadableConvertiblethrew an error increateUploadable().Declaration
Swift
case createUploadableFailed(error: any Error) -
URLRequestConvertiblethrew an error inasURLRequest().Declaration
Swift
case createURLRequestFailed(error: any Error) -
SessionDelegatethrew an error while attempting to move downloaded file to destination URL.Declaration
Swift
case downloadedFileMoveFailed(error: any Error, source: URL, destination: URL) -
Requestwas explicitly cancelled.Declaration
Swift
case explicitlyCancelled -
URLConvertibletype failed to create a validURL.Declaration
Swift
case invalidURL(url: any URLConvertible) -
Multipart form encoding failed.
Declaration
Swift
case multipartEncodingFailed(reason: MultipartEncodingFailureReason) -
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) -
RequestAdapterthrew an error during adaptation.Declaration
Swift
case requestAdaptationFailed(error: any Error) -
RequestRetrierthrew an error during the request retry process.Declaration
Swift
case requestRetryFailed(retryError: any Error, originalError: any Error) -
Response validation failed.
Declaration
Swift
case responseValidationFailed(reason: ResponseValidationFailureReason) -
Response serialization failed.
Declaration
Swift
case responseSerializationFailed(reason: ResponseSerializationFailureReason) -
ServerTrustEvaluatinginstance threw an error during trust evaluation.Declaration
Swift
case serverTrustEvaluationFailed(reason: ServerTrustFailureReason) -
Sessionwas explicitly invalidated, possibly with theErrorproduced by the underlyingURLSession.Declaration
Swift
case sessionInvalidated(error: (any Error)?) -
URLSessionTaskcompleted with error.Declaration
Swift
case sessionTaskFailed(error: any Error) -
URLRequestfailed validation.Declaration
Swift
case urlRequestValidationFailed(reason: URLRequestValidationFailureReason)
-
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,responseCode, andunderlyingErrorproperties 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. Whentrue, theunderlyingErrorproperty will contain the associated value.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 } -
Returns whether the instance is
createUploadableFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isCreateUploadableError: Bool { get } -
Returns whether the instance is
createURLRequestFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isCreateURLRequestError: Bool { get } -
Returns whether the instance is
downloadedFileMoveFailed. Whentrue, thedestinationandunderlyingErrorproperties will contain the associated values.Declaration
Swift
public var isDownloadedFileMoveError: Bool { get } -
Returns whether the instance is
createURLRequestFailed. Whentrue, theunderlyingErrorproperty will contain the associated value.Declaration
Swift
public var isSessionTaskError: Bool { get }
-
The
URLConvertibleassociated with the error.Declaration
Swift
public var urlConvertible: (any 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: (any 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 } -
The
sourceURL of a.downloadedFileMoveFailederror.Declaration
Swift
public var sourceURL: URL? { get } -
The
destinationURL of a.downloadedFileMoveFailederror.Declaration
Swift
public var destinationURL: URL? { get } -
The download resume data of any underlying network error. Only produced by
DownloadRequests.Declaration
Swift
public var downloadResumeData: Data? { get }
-
Declaration
Swift
public var errorDescription: String? { get }
View on GitHub
Install in Dash