One Logo Pool Ball
Foundation · IOS API REFERENCE

URLError

struct · iOS 8.0+ · SDK 27.1

struct URLError

Error codes returned by URL loading APIs. These error codes are for ``NSError`` objects in the domain ``NSURLErrorDomain``.

Members (56)

get · iOS 8.0+

failingURL

TypeScript
get failingURL(): (string) | null
Swift declaration
var failingURL: URL? { get }

The URL which caused a load to fail.

get · iOS 8.0+

errorDomain

TypeScript
static get errorDomain(): string
Swift declaration
static var errorDomain: String { get }

The domain of the error.

get · iOS 8.0+

callIsActive

TypeScript
static get callIsActive(): URLError_Code
Swift declaration
static var callIsActive: URLError.Code { get }

A connection was attempted while a phone call is active on a network that does not support simultaneous phone and data communication (EDGE or GPRS).

get · iOS 8.0+

cannotFindHost

TypeScript
static get cannotFindHost(): URLError_Code
Swift declaration
static var cannotFindHost: URLError.Code { get }

The host name for a URL could not be resolved.

get · iOS 8.0+

cannotMoveFile

TypeScript
static get cannotMoveFile(): URLError_Code
Swift declaration
static var cannotMoveFile: URLError.Code { get }

A download task was unable to move a downloaded file on disk.

get · iOS 8.0+

cannotOpenFile

TypeScript
static get cannotOpenFile(): URLError_Code
Swift declaration
static var cannotOpenFile: URLError.Code { get }

A download task was unable to open the downloaded file on disk.

get · iOS 8.0+

dataNotAllowed

TypeScript
static get dataNotAllowed(): URLError_Code
Swift declaration
static var dataNotAllowed: URLError.Code { get }

The cellular network disallowed a connection.

get · iOS 8.0+

unsupportedURL

TypeScript
static get unsupportedURL(): URLError_Code
Swift declaration
static var unsupportedURL: URLError.Code { get }

A properly formed URL couldn't be handled by the framework.

get · iOS 8.0+

cannotCloseFile

TypeScript
static get cannotCloseFile(): URLError_Code
Swift declaration
static var cannotCloseFile: URLError.Code { get }

A download task couldn't close the downloaded file on disk.

get · iOS 8.0+

dnsLookupFailed

TypeScript
static get dnsLookupFailed(): URLError_Code
Swift declaration
static var dnsLookupFailed: URLError.Code { get }

The host address could not be found via DNS lookup.

get · iOS 8.0+

fileIsDirectory

TypeScript
static get fileIsDirectory(): URLError_Code
Swift declaration
static var fileIsDirectory: URLError.Code { get }

A request for an FTP file resulted in the server responding that the file is not a plain file, but a directory.

get · iOS 8.0+

cannotCreateFile

TypeScript
static get cannotCreateFile(): URLError_Code
Swift declaration
static var cannotCreateFile: URLError.Code { get }

A download task couldn't create the downloaded file on disk because of an I/O failure.

get · iOS 8.0+

cannotRemoveFile

TypeScript
static get cannotRemoveFile(): URLError_Code
Swift declaration
static var cannotRemoveFile: URLError.Code { get }

A download task was unable to remove a downloaded file from disk.

get · iOS 8.0+ · Deprecated in iOS 18.4

failureURLString

TypeScript
get failureURLString(): (string) | null
Swift declaration
var failureURLString: String? { get }

The string for the URL which caused a load to fail.

get · iOS 8.0+

fileDoesNotExist

TypeScript
static get fileDoesNotExist(): URLError_Code
Swift declaration
static var fileDoesNotExist: URLError.Code { get }

A file does not exist.

get · iOS 8.0+

zeroByteResource

TypeScript
static get zeroByteResource(): URLError_Code
Swift declaration
static var zeroByteResource: URLError.Code { get }

A server reported that a URL has a non-zero content length, but terminated the network connection gracefully without sending any data.

get · iOS 8.0+

badServerResponse

TypeScript
static get badServerResponse(): URLError_Code
Swift declaration
static var badServerResponse: URLError.Code { get }

The URL Loading system received bad data from the server.

get · iOS 8.0+

cannotWriteToFile

TypeScript
static get cannotWriteToFile(): URLError_Code
Swift declaration
static var cannotWriteToFile: URLError.Code { get }

A download task was unable to write to the downloaded file on disk.

get · iOS 8.0+

cannotConnectToHost

TypeScript
static get cannotConnectToHost(): URLError_Code
Swift declaration
static var cannotConnectToHost: URLError.Code { get }

An attempt to connect to a host failed.

get · iOS 8.0+

cannotDecodeRawData

TypeScript
static get cannotDecodeRawData(): URLError_Code
Swift declaration
static var cannotDecodeRawData: URLError.Code { get }

Content data received during a connection request could not be decoded for a known content encoding.

get · iOS 8.0+

cannotParseResponse

TypeScript
static get cannotParseResponse(): URLError_Code
Swift declaration
static var cannotParseResponse: URLError.Code { get }

A task could not parse a response.

get · iOS 8.0+

failureURLPeerTrust

TypeScript
get failureURLPeerTrust(): (_Security_SecTrust) | null
Swift declaration
var failureURLPeerTrust: SecTrust? { get }

The state of a failed SSL handshake.

get · iOS 8.0+

resourceUnavailable

TypeScript
static get resourceUnavailable(): URLError_Code
Swift declaration
static var resourceUnavailable: URLError.Code { get }

A requested resource couldn't be retrieved.

get · iOS 8.0+

httpTooManyRedirects

TypeScript
static get httpTooManyRedirects(): URLError_Code
Swift declaration
static var httpTooManyRedirects: URLError.Code { get }

A redirect loop has been detected or the threshold for number of allowable redirects has been exceeded (currently 16).

get · iOS 17.0+

uploadTaskResumeData

TypeScript
get uploadTaskResumeData(): (ArrayBuffer) | null
Swift declaration
var uploadTaskResumeData: Data? { get }

An opaque data blob to resume a failed upload task.

get · iOS 8.0+

cannotLoadFromNetwork

TypeScript
static get cannotLoadFromNetwork(): URLError_Code
Swift declaration
static var cannotLoadFromNetwork: URLError.Code { get }

A request to load an item only from the cache could not be satisfied.

get · iOS 8.0+

networkConnectionLost

TypeScript
static get networkConnectionLost(): URLError_Code
Swift declaration
static var networkConnectionLost: URLError.Code { get }

A client or server connection was severed in the middle of an in-progress load.

get · iOS 13.0+

downloadTaskResumeData

TypeScript
get downloadTaskResumeData(): (ArrayBuffer) | null
Swift declaration
var downloadTaskResumeData: Data? { get }

An opaque data object used to resume a failed download task.

get · iOS 8.0+

notConnectedToInternet

TypeScript
static get notConnectedToInternet(): URLError_Code
Swift declaration
static var notConnectedToInternet: URLError.Code { get }

A network resource was requested, but an internet connection has not been established and cannot be established automatically.

get · iOS 8.0+

secureConnectionFailed

TypeScript
static get secureConnectionFailed(): URLError_Code
Swift declaration
static var secureConnectionFailed: URLError.Code { get }

An attempt to establish a secure connection failed for reasons that can't be expressed more specifically.

get · iOS 8.0+

cannotDecodeContentData

TypeScript
static get cannotDecodeContentData(): URLError_Code
Swift declaration
static var cannotDecodeContentData: URLError.Code { get }

Content data received during a connection request had an unknown content encoding.

get · iOS 8.0+

internationalRoamingOff

TypeScript
static get internationalRoamingOff(): URLError_Code
Swift declaration
static var internationalRoamingOff: URLError.Code { get }

The attempted connection required activating a data context while roaming, but international roaming is disabled.

get · iOS 8.0+

noPermissionsToReadFile

TypeScript
static get noPermissionsToReadFile(): URLError_Code
Swift declaration
static var noPermissionsToReadFile: URLError.Code { get }

A resource couldn't be read because of insufficient permissions.

get · iOS 8.0+

dataLengthExceedsMaximum

TypeScript
static get dataLengthExceedsMaximum(): URLError_Code
Swift declaration
static var dataLengthExceedsMaximum: URLError.Code { get }

The length of the resource data exceeds the maximum allowed.

get · iOS 13.0+

networkUnavailableReason

TypeScript
get networkUnavailableReason(): (URLError_NetworkUnavailableReason) | null
Swift declaration
var networkUnavailableReason: URLError.NetworkUnavailableReason? { get }

The reason the network was unavailable for a task.

get · iOS 8.0+

clientCertificateRejected

TypeScript
static get clientCertificateRejected(): URLError_Code
Swift declaration
static var clientCertificateRejected: URLError.Code { get }

A server certificate was rejected.

get · iOS 8.0+

clientCertificateRequired

TypeScript
static get clientCertificateRequired(): URLError_Code
Swift declaration
static var clientCertificateRequired: URLError.Code { get }

A client certificate was required to authenticate an SSL connection during a request.

get · iOS 8.0+

requestBodyStreamExhausted

TypeScript
static get requestBodyStreamExhausted(): URLError_Code
Swift declaration
static var requestBodyStreamExhausted: URLError.Code { get }

A body stream is needed but the client did not provide one.

get · iOS 8.0+

serverCertificateUntrusted

TypeScript
static get serverCertificateUntrusted(): URLError_Code
Swift declaration
static var serverCertificateUntrusted: URLError.Code { get }

A server certificate was signed by a root server that isn't trusted.

get · iOS 8.0+

userAuthenticationRequired

TypeScript
static get userAuthenticationRequired(): URLError_Code
Swift declaration
static var userAuthenticationRequired: URLError.Code { get }

Authentication is required to access a resource.

get · iOS 8.0+

serverCertificateHasBadDate

TypeScript
static get serverCertificateHasBadDate(): URLError_Code
Swift declaration
static var serverCertificateHasBadDate: URLError.Code { get }

A server certificate had a date which indicates it has expired, or is not yet valid.

get · iOS 8.0+

userCancelledAuthentication

TypeScript
static get userCancelledAuthentication(): URLError_Code
Swift declaration
static var userCancelledAuthentication: URLError.Code { get }

An asynchronous request for authentication has been canceled by the user.

get · iOS 8.0+

serverCertificateNotYetValid

TypeScript
static get serverCertificateNotYetValid(): URLError_Code
Swift declaration
static var serverCertificateNotYetValid: URLError.Code { get }

A server certificate is not yet valid.

get · iOS 13.0+

backgroundTaskCancelledReason

TypeScript
get backgroundTaskCancelledReason(): (URLError_BackgroundTaskCancelledReason) | null
Swift declaration
var backgroundTaskCancelledReason: URLError.BackgroundTaskCancelledReason? { get }

The reason for canceling a background task.

get · iOS 8.0+

redirectToNonExistentLocation

TypeScript
static get redirectToNonExistentLocation(): URLError_Code
Swift declaration
static var redirectToNonExistentLocation: URLError.Code { get }

A redirect was specified by way of server response code, but the server did not accompany this code with a redirect URL.

get · iOS 8.0+

downloadDecodingFailedMidStream

TypeScript
static get downloadDecodingFailedMidStream(): URLError_Code
Swift declaration
static var downloadDecodingFailedMidStream: URLError.Code { get }

A download task failed to decode an encoded file during the download.

get · iOS 8.0+

serverCertificateHasUnknownRoot

TypeScript
static get serverCertificateHasUnknownRoot(): URLError_Code
Swift declaration
static var serverCertificateHasUnknownRoot: URLError.Code { get }

A server certificate was not signed by any root server.

get · iOS 8.0+

backgroundSessionWasDisconnected

TypeScript
static get backgroundSessionWasDisconnected(): URLError_Code
Swift declaration
static var backgroundSessionWasDisconnected: URLError.Code { get }

The app is suspended or exits while a background data task is processing.

get · iOS 8.0+

downloadDecodingFailedToComplete

TypeScript
static get downloadDecodingFailedToComplete(): URLError_Code
Swift declaration
static var downloadDecodingFailedToComplete: URLError.Code { get }

A download task failed to decode an encoded file after downloading.

get · iOS 8.0+

backgroundSessionInUseByAnotherProcess

TypeScript
static get backgroundSessionInUseByAnotherProcess(): URLError_Code
Swift declaration
static var backgroundSessionInUseByAnotherProcess: URLError.Code { get }

An app or app extension attempted to connect to a background session that is already connected to a process.

get · iOS 8.0+

backgroundSessionRequiresSharedContainer

TypeScript
static get backgroundSessionRequiresSharedContainer(): URLError_Code
Swift declaration
static var backgroundSessionRequiresSharedContainer: URLError.Code { get }

The shared container identifier of the URL session configuration is needed but has not been set.

get · iOS 9.0+

appTransportSecurityRequiresSecureConnection

TypeScript
static get appTransportSecurityRequiresSecureConnection(): URLError_Code
Swift declaration
static var appTransportSecurityRequiresSecureConnection: URLError.Code { get }

App Transport Security disallowed a connection because there is no secure network connection.

get · iOS 8.0+

badURL

TypeScript
static get badURL(): URLError_Code
Swift declaration
static var badURL: URLError.Code { get }

A malformed URL prevented a URL request from being initiated.

get · iOS 8.0+

unknown

TypeScript
static get unknown(): URLError_Code
Swift declaration
static var unknown: URLError.Code { get }

The URL Loading System encountered an error that it can't interpret.

get · iOS 8.0+

timedOut

TypeScript
static get timedOut(): URLError_Code
Swift declaration
static var timedOut: URLError.Code { get }

An asynchronous operation timed out.

get · iOS 8.0+

cancelled

TypeScript
static get cancelled(): URLError_Code
Swift declaration
static var cancelled: URLError.Code { get }

An asynchronous load has been canceled.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →