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.multipartEncodingFailed
error 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
.inputStreamReadFailed
case.Declaration
Swift
public struct UnexpectedInputStreamLength : Error
-
The underlying reason the
See more.parameterEncodingFailed
error occurred.Declaration
Swift
public enum ParameterEncodingFailureReason : Sendable
-
The underlying reason the
See more.parameterEncoderFailed
error occurred.Declaration
Swift
public enum ParameterEncoderFailureReason : Sendable
-
The underlying reason the
See more.responseValidationFailed
error 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.urlRequestValidationFailed
error occurred.Declaration
Swift
public enum URLRequestValidationFailureReason : Sendable
-
UploadableConvertible
threw an error increateUploadable()
.Declaration
Swift
case createUploadableFailed(error: any Error)
-
URLRequestConvertible
threw an error inasURLRequest()
.Declaration
Swift
case createURLRequestFailed(error: any Error)
-
SessionDelegate
threw an error while attempting to move downloaded file to destination URL.Declaration
Swift
case downloadedFileMoveFailed(error: any Error, source: URL, destination: URL)
-
Request
was explicitly cancelled.Declaration
Swift
case explicitlyCancelled
-
URLConvertible
type failed to create a validURL
.Declaration
Swift
case invalidURL(url: any URLConvertible)
-
Multipart form encoding failed.
Declaration
Swift
case multipartEncodingFailed(reason: MultipartEncodingFailureReason)
-
ParameterEncoding
threw an error during the encoding process.Declaration
Swift
case parameterEncodingFailed(reason: ParameterEncodingFailureReason)
-
ParameterEncoder
threw an error while running the encoder.Declaration
Swift
case parameterEncoderFailed(reason: ParameterEncoderFailureReason)
-
RequestAdapter
threw an error during adaptation.Declaration
Swift
case requestAdaptationFailed(error: any Error)
-
RequestRetrier
threw 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)
-
ServerTrustEvaluating
instance threw an error during trust evaluation.Declaration
Swift
case serverTrustEvaluationFailed(reason: ServerTrustFailureReason)
-
Session
was explicitly invalidated, possibly with theError
produced by the underlyingURLSession
.Declaration
Swift
case sessionInvalidated(error: (any Error)?)
-
URLSessionTask
completed with error.Declaration
Swift
case sessionTaskFailed(error: any Error)
-
URLRequest
failed 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
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isParameterEncodingError: Bool { get }
-
Returns whether the instance is
.parameterEncoderFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isParameterEncoderError: Bool { get }
-
Returns whether the instance is
.multipartEncodingFailed
. Whentrue
, theurl
andunderlyingError
properties will contain the associated values.Declaration
Swift
public var isMultipartEncodingError: Bool { get }
-
Returns whether the instance is
.requestAdaptationFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isRequestAdaptationError: Bool { get }
-
Returns whether the instance is
.responseValidationFailed
. Whentrue
, theacceptableContentTypes
,responseContentType
,responseCode
, andunderlyingError
properties will contain the associated values.Declaration
Swift
public var isResponseValidationError: Bool { get }
-
Returns whether the instance is
.responseSerializationFailed
. Whentrue
, thefailedStringEncoding
andunderlyingError
properties will contain the associated values.Declaration
Swift
public var isResponseSerializationError: Bool { get }
-
Returns whether the instance is
.serverTrustEvaluationFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isServerTrustEvaluationError: Bool { get }
-
Returns whether the instance is
requestRetryFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isRequestRetryError: Bool { get }
-
Returns whether the instance is
createUploadableFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isCreateUploadableError: Bool { get }
-
Returns whether the instance is
createURLRequestFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isCreateURLRequestError: Bool { get }
-
Returns whether the instance is
downloadedFileMoveFailed
. Whentrue
, thedestination
andunderlyingError
properties will contain the associated values.Declaration
Swift
public var isDownloadedFileMoveError: Bool { get }
-
Returns whether the instance is
createURLRequestFailed
. Whentrue
, theunderlyingError
property will contain the associated value.Declaration
Swift
public var isSessionTaskError: Bool { get }
-
The
URLConvertible
associated with the error.Declaration
Swift
public var urlConvertible: (any URLConvertible)? { get }
-
The
URL
associated with the error.Declaration
Swift
public var url: URL? { get }
-
The underlying
Error
responsible for generating the failure associated with.sessionInvalidated
,.parameterEncodingFailed
,.parameterEncoderFailed
,.multipartEncodingFailed
,.requestAdaptationFailed
,.responseSerializationFailed
,.requestRetryFailed
errors.Declaration
Swift
public var underlyingError: (any Error)? { get }
-
The acceptable
Content-Type
s of a.responseValidationFailed
error.Declaration
Swift
public var acceptableContentTypes: [String]? { get }
-
The response
Content-Type
of a.responseValidationFailed
error.Declaration
Swift
public var responseContentType: String? { get }
-
The response code of a
.responseValidationFailed
error.Declaration
Swift
public var responseCode: Int? { get }
-
The
String.Encoding
associated with a failed.stringResponse()
call.Declaration
Swift
public var failedStringEncoding: String.Encoding? { get }
-
The
source
URL of a.downloadedFileMoveFailed
error.Declaration
Swift
public var sourceURL: URL? { get }
-
The
destination
URL of a.downloadedFileMoveFailed
error.Declaration
Swift
public var destinationURL: URL? { get }
-
The download resume data of any underlying network error. Only produced by
DownloadRequest
s.Declaration
Swift
public var downloadResumeData: Data? { get }
-
Declaration
Swift
public var errorDescription: String? { get }