NSError Codes

NSError codes in the Cocoa error domain.

Overview

The constants in this enumeration are NSError code numbers in the Cocoa error domain (NSCocoaErrorDomain). Other frameworks, most notably the Application Kit, provide their own NSCocoaErrorDomain error codes.

The enumeration constants beginning with NSFile indicate file-system errors or errors related to file I/O operations. Use the key NSFilePathErrorKey or the NSURLErrorKey (whichever is appropriate) to access the file-system path or URL in the userInfo dictionary of the NSError object.

Topics

Constants

var NSExecutableArchitectureMismatchError: Int

Executable does not provide an architecture compatible with the current process.

var NSExecutableErrorMaximum: Int

Marks end of the range of error codes reserved for errors related to executable files.

var NSExecutableErrorMinimum: Int

Marks beginning of the range of error codes reserved for errors related to executable files.

var NSExecutableLinkError: Int

Executable fails due to linking issues.

var NSExecutableLoadError: Int

Executable cannot be loaded for some other reason, such as a problem with a library it depends on.

var NSExecutableNotLoadableError: Int

Executable is of a type that is not loadable in the current process.

var NSExecutableRuntimeMismatchError: Int

Executable has Objective C runtime information incompatible with the current process.

var NSFeatureUnsupportedError: Int

The feature is not supported, either because the file system lacks the feature, or required libraries are missing, or other similar reasons.

var NSFormattingErrorMinimum: Int

Marks the start of the range of error codes reserved for formatting errors.

var NSFormattingErrorMaximum: Int

Marks end of the range of error codes reserved for formatting errors.

var NSFileErrorMaximum: Int

Marks the end of the range of error codes reserved for file errors.

var NSFileErrorMinimum: Int

Marks the start of the range of error codes reserved for file errors.

var NSFileLockingError: Int

Failure to get a lock on file.

var NSFileManagerUnmountBusyError: Int

The volume could not be unmounted because it is in use.

var NSFileManagerUnmountUnknownError: Int

The volume could not be unmounted, reason unknown.

var NSFileNoSuchFileError: Int

File-system operation attempted on non-existent file.

var NSFileReadCorruptFileError: Int

Read error because of a corrupted file, bad format, or similar reason.

var NSFileReadInapplicableStringEncodingError: Int

Read error because the string encoding was not applicable.

var NSFileReadInvalidFileNameError: Int

Read error because of an invalid file name.

var NSFileReadNoPermissionError: Int

Read error because of a permission problem.

var NSFileReadNoSuchFileError: Int

Read error because no such file was found.

var NSFileReadTooLargeError: Int

Read error because the specified file was too large.

var NSFileReadUnknownError: Int

Read error, reason unknown.

var NSFileReadUnknownStringEncodingError: Int

Read error because the string coding of the file could not be determined.

var NSFileReadUnsupportedSchemeError: Int

Read error because the specified URL scheme is unsupported.

var NSFileWriteFileExistsError: Int

Write error returned when NSFileManager class’s copy, move, and link methods report errors when the destination file already exists.

var NSFileWriteInapplicableStringEncodingError: Int

Write error because the string encoding was not applicable.

var NSFileWriteInvalidFileNameError: Int

Write error because of an invalid file name.

var NSFileWriteNoPermissionError: Int

Write error because of a permission problem.

var NSFileWriteOutOfSpaceError: Int

Write error because of a lack of disk space.

var NSFileWriteUnknownError: Int

Write error, reason unknown.

var NSFileWriteUnsupportedSchemeError: Int

Write error because the specified URL scheme is unsupported.

var NSFileWriteVolumeReadOnlyError: Int

Write error because because the volume is read only.

var NSFormattingError: Int

Formatting error (related to display of data)

var NSKeyValueValidationError: Int

Key-value coding validation error.

var NSPropertyListErrorMaximum: Int

Marks end of the range of error codes reserved for property list errors.

var NSPropertyListErrorMinimum: Int

Marks beginning of the range of error codes reserved for property list errors.

var NSPropertyListReadCorruptError: Int

An error was encountered while parsing the property list.

var NSPropertyListReadStreamError: Int

An stream error was encountered while reading the property list.

var NSPropertyListReadUnknownVersionError: Int

The version number of the property list is unable to be determined.

var NSPropertyListWriteStreamError: Int

An stream error was encountered while writing the property list.

var NSUbiquitousFileErrorMaximum: Int

The maximum error code value that represents an iCloud error.

var NSUbiquitousFileErrorMinimum: Int

The minimum error code value that represents an iCloud error.

var NSUbiquitousFileNotUploadedDueToQuotaError: Int

The item could not be uploaded to iCloud because it would make the account go over its quota.

var NSUbiquitousFileUbiquityServerNotAvailable: Int

Connecting to the iCloud servers failed.

var NSUbiquitousFileUnavailableError: Int

The item has not been uploaded to iCloud by another device yet.

var NSUserCancelledError: Int

The user cancelled the operation (for example, by pressing Command-period).

var NSValidationErrorMinimum: Int

Marks the start of the range of error codes reserved for validation errors.

var NSValidationErrorMaximum: Int

Marks the start and end of the range of error codes reserved for validation errors.

var NSXPCConnectionErrorMaximum: Int

The upper bounds of XPC connection error code values. All XPC error codes have values between NSXPCConnectionErrorMinimum and NSXPCConnectionErrorMaximum, exclusive. This constant does not correspond to any particular error.

var NSXPCConnectionErrorMinimum: Int

The lower bounds of XPC connection error code values. All XPC error codes have values between NSXPCConnectionErrorMinimum and NSXPCConnectionErrorMaximum, exclusive. This constant does not correspond to any particular error.

var NSXPCConnectionInterrupted: Int

The XPC connection was interrupted.

var NSXPCConnectionInvalid: Int

The XPC connection was invalid.

var NSXPCConnectionReplyInvalid: Int

The XPC connection reply was invalid.

var NSURLErrorBadServerResponse: Int

Returned when the URL Loading system receives bad data from the server.

var NSURLErrorBadURL: Int

Returned when a URL is sufficiently malformed that a URL request cannot be initiated

var NSURLErrorCallIsActive: Int

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

var NSURLErrorCancelled: Int

Returned when an asynchronous load is canceled.

var NSURLErrorCannotCloseFile: Int

Returned when NSURLDownload was unable to close the downloaded file on disk.

var NSURLErrorCannotConnectToHost: Int

Returned when an attempt to connect to a host has failed.

var NSURLErrorCannotCreateFile: Int

Returned when NSURLDownload object was unable to create the downloaded file on disk due to a I/O failure.

var NSURLErrorCannotDecodeContentData: Int

Returned when content data received during an NSURLConnection request has an unknown content encoding.

var NSURLErrorCannotDecodeRawData: Int

Returned when content data received during an NSURLConnection request cannot be decoded for a known content encoding.

var NSURLErrorCannotFindHost: Int

Returned when the host name for a URL cannot be resolved.

var NSURLErrorCannotLoadFromNetwork: Int

Returned when a specific request to load an item only from the cache cannot be satisfied.

var NSURLErrorCannotMoveFile: Int

Returned when NSURLDownload was unable to move a downloaded file on disk.

var NSURLErrorCannotOpenFile: Int

Returned when NSURLDownload was unable to open the downloaded file on disk.

var NSURLErrorCannotParseResponse: Int

Returned when a response to an NSURLConnection request cannot be parsed.

var NSURLErrorCannotRemoveFile: Int

Returned when NSURLDownload was unable to remove a downloaded file from disk.

var NSURLErrorCannotWriteToFile: Int

Returned when NSURLDownload was unable to write to the downloaded file on disk.

var NSURLErrorClientCertificateRejected: Int

Returned when a server certificate is rejected.

var NSURLErrorClientCertificateRequired: Int

Returned when a client certificate is required to authenticate an SSL connection during an NSURLConnection request.

var NSURLErrorDataLengthExceedsMaximum: Int

Returned when the length of the resource data exceeds the maximum allowed.

var NSURLErrorDataNotAllowed: Int

Returned when the cellular network disallows a connection.

var NSURLErrorDownloadDecodingFailedMidStream: Int

Returned when NSURLDownload failed to decode an encoded file during the download.

var NSURLErrorDownloadDecodingFailedToComplete: Int

Returned when NSURLDownload failed to decode an encoded file after downloading.

var NSURLErrorFileDoesNotExist: Int

Returned when a file does not exist.

var NSURLErrorFileIsDirectory: Int

Returned when a request for an FTP file results in the server responding that the file is not a plain file, but a directory.

var NSURLErrorHTTPTooManyRedirects: Int

Returned when a redirect loop is detected or when the threshold for number of allowable redirects has been exceeded (currently 16).

var NSURLErrorInternationalRoamingOff: Int

Returned when a connection would require activating a data context while roaming, but international roaming is disabled.

var NSURLErrorNetworkConnectionLost: Int

Returned when a client or server connection is severed in the middle of an in-progress load.

var NSURLErrorNoPermissionsToReadFile: Int

Returned when a resource cannot be read due to insufficient permissions.

var NSURLErrorNotConnectedToInternet: Int

Returned when a network resource was requested, but an internet connection is not established and cannot be established automatically, either through a lack of connectivity, or by the user's choice not to make a network connection automatically.

var NSURLErrorRedirectToNonExistentLocation: Int

Returned when a redirect is specified by way of server response code, but the server does not accompany this code with a redirect URL.

var NSURLErrorRequestBodyStreamExhausted: Int

Returned when a body stream is needed but the client does not provide one. This impacts clients on iOS that send a POST request using a body stream but do not implement the NSURLConnection delegate method connection:needNewBodyStream.

var NSURLErrorResourceUnavailable: Int

Returned when a requested resource cannot be retrieved.

var NSURLErrorSecureConnectionFailed: Int

Returned when an attempt to establish a secure connection fails for reasons which cannot be expressed more specifically.

var NSURLErrorServerCertificateHasBadDate: Int

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

var NSURLErrorServerCertificateHasUnknownRoot: Int

Returned when a server certificate is not signed by any root server.

var NSURLErrorServerCertificateNotYetValid: Int

Returned when a server certificate is not yet valid.

var NSURLErrorServerCertificateUntrusted: Int

Returned when a server certificate is signed by a root server which is not trusted.

var NSURLErrorTimedOut: Int

Returned when an asynchronous operation times out.

var NSURLErrorUnknown: Int

Returned when the URL Loading system encounters an error that it cannot interpret.

var NSURLErrorUnsupportedURL: Int

Returned when a properly formed URL cannot be handled by the framework.

var NSURLErrorUserAuthenticationRequired: Int

Returned when authentication is required to access a resource.

var NSURLErrorUserCancelledAuthentication: Int

Returned when an asynchronous request for authentication is cancelled by the user.

var NSURLErrorZeroByteResource: Int

Returned when a server reports that a URL has a non-zero content length, but terminates the network connection “gracefully” without sending any data.

See Also

Error Codes

struct CocoaError

Describes errors within the Cocoa error domain.

struct MachError

Describes an error in the Mach error domain.

struct POSIXError

Describes an error in the POSIX error domain.