Global Variable


A specific request to load an item only from the cache couldn't be satisfied.


var NSURLErrorCannotLoadFromNetwork: Int { get }


This error is sent when the task needs to load from the network, but is blocked from doing so by the “load only from cache” directive.

See Also

URL Errors

var NSURLErrorAppTransportSecurityRequiresSecureConnection: Int

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

var NSURLErrorBackgroundSessionInUseByAnotherProcess: Int

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

var NSURLErrorBackgroundSessionRequiresSharedContainer: Int

The shared container identifier of the URL session configuration is needed but hasn’t been set.

var NSURLErrorBackgroundSessionWasDisconnected: Int

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

var NSURLErrorBadServerResponse: Int

The URL Loading System received bad data from the server.

var NSURLErrorBadURL: Int

A malformed URL prevented a URL request from being initiated.

var NSURLErrorCallIsActive: Int

A connection was attempted while a phone call was active on a network that doesn’t support simultaneous phone and data communication, such as EDGE or GPRS.

var NSURLErrorCancelled: Int

An asynchronous load has been canceled.

var NSURLErrorCannotCloseFile: Int

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

var NSURLErrorCannotConnectToHost: Int

An attempt to connect to a host failed.

var NSURLErrorCannotCreateFile: Int

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

var NSURLErrorCannotDecodeContentData: Int

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

var NSURLErrorCannotDecodeRawData: Int

Content data received during a connection request couldn’t be decoded for a known content encoding.

var NSURLErrorCannotFindHost: Int

The host name for a URL couldn’t be resolved.

var NSURLErrorCannotMoveFile: Int

A downloaded file on disk couldn’t be moved.

var NSURLErrorCannotOpenFile: Int

A downloaded file on disk couldn’t be opened.

var NSURLErrorCannotParseResponse: Int

A response to a connection request couldn’t be parsed.

var NSURLErrorCannotRemoveFile: Int

A downloaded file couldn’t be removed from disk.

var NSURLErrorCannotWriteToFile: Int

A download task couldn’t write the file to disk.

var NSURLErrorClientCertificateRejected: Int

A server certificate was rejected.

var NSURLErrorClientCertificateRequired: Int

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

var NSURLErrorDNSLookupFailed: Int

The host address couldn’t be found via DNS lookup.

var NSURLErrorDataLengthExceedsMaximum: Int

The length of the resource data exceeded the maximum allowed.

var NSURLErrorDataNotAllowed: Int

The cellular network disallowed a connection.

var NSURLErrorDownloadDecodingFailedMidStream: Int

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

var NSURLErrorDownloadDecodingFailedToComplete: Int

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

var NSURLErrorFileDoesNotExist: Int

The specified file doesn’t exist.

var NSURLErrorFileIsDirectory: Int

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

var NSURLErrorFileOutsideSafeArea: Int

An internal file operation failed.

var NSURLErrorHTTPTooManyRedirects: Int

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

var NSURLErrorInternationalRoamingOff: Int

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

var NSURLErrorNetworkConnectionLost: Int

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

var NSURLErrorNoPermissionsToReadFile: Int

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

var NSURLErrorNotConnectedToInternet: Int

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

var NSURLErrorRedirectToNonExistentLocation: Int

A redirect was specified by way of server response code, but the server didn’t accompany this code with a redirect URL.

var NSURLErrorRequestBodyStreamExhausted: Int

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

var NSURLErrorResourceUnavailable: Int

A requested resource couldn’t be retrieved.

var NSURLErrorSecureConnectionFailed: Int

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

var NSURLErrorServerCertificateHasBadDate: Int

A server certificate is expired, or is not yet valid.

var NSURLErrorServerCertificateHasUnknownRoot: Int

A server certificate wasn’t signed by any root server.

var NSURLErrorServerCertificateNotYetValid: Int

A server certificate isn’t valid yet.

var NSURLErrorServerCertificateUntrusted: Int

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

var NSURLErrorTimedOut: Int

An asynchronous operation timed out.

var NSURLErrorUnknown: Int

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

var NSURLErrorUnsupportedURL: Int

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

var NSURLErrorUserAuthenticationRequired: Int

Authentication was required to access a resource.

var NSURLErrorUserCancelledAuthentication: Int

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

var NSURLErrorZeroByteResource: Int

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