<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/1448136-nserror-codes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "NSError Codes"
}
-->

# NSError Codes

Error codes in the Cocoa error domain.

## Discussion

The constants in this enumeration are [`NSError`](/documentation/Foundation/NSError) code numbers in the Cocoa error domain ([`NSCocoaErrorDomain`](/documentation/Foundation/NSCocoaErrorDomain)). Other frameworks, most notably the Application Kit, provide their own [`NSCocoaErrorDomain`](/documentation/Foundation/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`](/documentation/Foundation/NSFilePathErrorKey) or the [`NSURLErrorKey`](/documentation/Foundation/NSURLErrorKey) (whichever is appropriate) to access the file-system path or URL in the [`userInfo`](/documentation/Foundation/NSError/userInfo) dictionary of the [`NSError`](/documentation/Foundation/NSError) object.

## Topics

### Bundle Errors

[`NSBundleErrorMinimum`](/documentation/Foundation/NSBundleErrorMinimum-swift.var)

The start of the range of error codes reserved for bundle errors.

[`NSBundleErrorMaximum`](/documentation/Foundation/NSBundleErrorMaximum-swift.var)

The end of the range of error codes reserved for bundle errors.

[`NSBundleOnDemandResourceExceededMaximumSizeError`](/documentation/Foundation/NSBundleOnDemandResourceExceededMaximumSizeError-swift.var)

The application exceeded the amount of on-demand resources content in use at one time.

[`NSBundleOnDemandResourceInvalidTagError`](/documentation/Foundation/NSBundleOnDemandResourceInvalidTagError-swift.var)

The application specified a tag that the system couldn’t find in the application tag manifest.

[`NSBundleOnDemandResourceOutOfSpaceError`](/documentation/Foundation/NSBundleOnDemandResourceOutOfSpaceError-swift.var)

Insufficient space available to download the requested on-demand resources.

### Cancellation

[`NSUserCancelledError`](/documentation/Foundation/NSUserCancelledError-swift.var)

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

### Cloud-Sharing Errors

[`NSCloudSharingErrorMinimum`](/documentation/Foundation/NSCloudSharingErrorMinimum-swift.var)

The start of the range of error codes reserved for cloud-sharing errors.

[`NSCloudSharingErrorMaximum`](/documentation/Foundation/NSCloudSharingErrorMaximum-swift.var)

The end of the range of error codes reserved for cloud-sharing errors.

[`NSCloudSharingConflictError`](/documentation/Foundation/NSCloudSharingConflictError-swift.var)

A conflict occurred during an attempt to save changes.

[`NSCloudSharingNetworkFailureError`](/documentation/Foundation/NSCloudSharingNetworkFailureError-swift.var)

Sharing failed due to a network failure.

[`NSCloudSharingNoPermissionError`](/documentation/Foundation/NSCloudSharingNoPermissionError-swift.var)

The current user doesn’t have permission to perform the requested actions.

[`NSCloudSharingOtherError`](/documentation/Foundation/NSCloudSharingOtherError-swift.var)

An otherwise unspecified cloud-sharing error occurred.

[`NSCloudSharingQuotaExceededError`](/documentation/Foundation/NSCloudSharingQuotaExceededError-swift.var)

The user doesn’t have enough storage space available to share the requested items.

[`NSCloudSharingTooManyParticipantsError`](/documentation/Foundation/NSCloudSharingTooManyParticipantsError-swift.var)

Additional participants couldn’t be added to the share, because the limit was reached.

### Coder Errors

[`NSCoderErrorMinimum`](/documentation/Foundation/NSCoderErrorMinimum-swift.var)

The start of the range of error codes reserved for coder errors.

[`NSCoderErrorMaximum`](/documentation/Foundation/NSCoderErrorMaximum-swift.var)

The end of the range of error codes reserved for coder errors.

[`NSCoderValueNotFoundError`](/documentation/Foundation/NSCoderValueNotFoundError-swift.var)

The requested data wasn’t found.

[`NSCoderReadCorruptError`](/documentation/Foundation/NSCoderReadCorruptError-swift.var)

Decoding failed due to corrupt data.

### Executable Errors

[`NSExecutableErrorMinimum`](/documentation/Foundation/NSExecutableErrorMinimum-swift.var)

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

[`NSExecutableErrorMaximum`](/documentation/Foundation/NSExecutableErrorMaximum-swift.var)

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

[`NSExecutableArchitectureMismatchError`](/documentation/Foundation/NSExecutableArchitectureMismatchError-swift.var)

The executable doesn’t provide an architecture compatible with the current process.

[`NSExecutableLinkError`](/documentation/Foundation/NSExecutableLinkError-swift.var)

The executable failed due to linking issues.

[`NSExecutableLoadError`](/documentation/Foundation/NSExecutableLoadError-swift.var)

Executable cannot be loaded for an otherwise-unspecified reason.

[`NSExecutableNotLoadableError`](/documentation/Foundation/NSExecutableNotLoadableError-swift.var)

The executable type isn’t loadable in the current process.

[`NSExecutableRuntimeMismatchError`](/documentation/Foundation/NSExecutableRuntimeMismatchError-swift.var)

The executable has Objective-C runtime information that’s incompatible with the current process.

### Formatting Errors

[`NSFormattingErrorMinimum`](/documentation/Foundation/NSFormattingErrorMinimum-swift.var)

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

[`NSFormattingErrorMaximum`](/documentation/Foundation/NSFormattingErrorMaximum-swift.var)

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

[`NSFormattingError`](/documentation/Foundation/NSFormattingError-swift.var)

A formatter couldn’t generate a string for an object, or parse a string into an object.

### File Errors

[`NSFileErrorMinimum`](/documentation/Foundation/NSFileErrorMinimum-swift.var)

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

[`NSFileErrorMaximum`](/documentation/Foundation/NSFileErrorMaximum-swift.var)

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

[`NSFileLockingError`](/documentation/Foundation/NSFileLockingError-swift.var)

The file could not be locked.

[`NSFileManagerUnmountBusyError`](/documentation/Foundation/NSFileManagerUnmountBusyError-swift.var)

The volume couldn’t be unmounted because it’s in use.

[`NSFileManagerUnmountUnknownError`](/documentation/Foundation/NSFileManagerUnmountUnknownError-swift.var)

The volume couldn’t be unmounted, for unknown reasons.

[`NSFileNoSuchFileError`](/documentation/Foundation/NSFileNoSuchFileError-swift.var)

A filesystem operation was attempted on a non-existent file.

### File Reading Errors

[`NSFileReadCorruptFileError`](/documentation/Foundation/NSFileReadCorruptFileError-swift.var)

Could not read because of a corrupted file, bad format, or similar reason.

[`NSFileReadInapplicableStringEncodingError`](/documentation/Foundation/NSFileReadInapplicableStringEncodingError-swift.var)

Could not read because the string encoding wasn’t applicable.

[`NSFileReadInvalidFileNameError`](/documentation/Foundation/NSFileReadInvalidFileNameError-swift.var)

Could not read because of an invalid file name.

[`NSFileReadNoPermissionError`](/documentation/Foundation/NSFileReadNoPermissionError-swift.var)

Could not read because of a permission problem.

[`NSFileReadNoSuchFileError`](/documentation/Foundation/NSFileReadNoSuchFileError-swift.var)

Could not read because no such file was found.

[`NSFileReadTooLargeError`](/documentation/Foundation/NSFileReadTooLargeError-swift.var)

Could not read because the specified file was too large.

[`NSFileReadUnknownError`](/documentation/Foundation/NSFileReadUnknownError-swift.var)

Could not read, for unknown reasons.

[`NSFileReadUnknownStringEncodingError`](/documentation/Foundation/NSFileReadUnknownStringEncodingError-swift.var)

Could not read because the string coding of the file couldn’t be determined.

[`NSFileReadUnsupportedSchemeError`](/documentation/Foundation/NSFileReadUnsupportedSchemeError-swift.var)

Could not read because the specified URL scheme is unsupported.

### File Writing Errors

[`NSFileWriteFileExistsError`](/documentation/Foundation/NSFileWriteFileExistsError-swift.var)

Could not perform an operation because the destination file already exists.

[`NSFileWriteInapplicableStringEncodingError`](/documentation/Foundation/NSFileWriteInapplicableStringEncodingError-swift.var)

Could not write because the string encoding was not applicable.

[`NSFileWriteInvalidFileNameError`](/documentation/Foundation/NSFileWriteInvalidFileNameError-swift.var)

Could not write because of an invalid file name.

[`NSFileWriteNoPermissionError`](/documentation/Foundation/NSFileWriteNoPermissionError-swift.var)

Could not write because of a permission problem.

[`NSFileWriteOutOfSpaceError`](/documentation/Foundation/NSFileWriteOutOfSpaceError-swift.var)

Could not write because of a lack of disk space.

[`NSFileWriteUnknownError`](/documentation/Foundation/NSFileWriteUnknownError-swift.var)

Could not write, for unknown reasons.

[`NSFileWriteUnsupportedSchemeError`](/documentation/Foundation/NSFileWriteUnsupportedSchemeError-swift.var)

Could not write because the specified URL scheme is unsupported.

[`NSFileWriteVolumeReadOnlyError`](/documentation/Foundation/NSFileWriteVolumeReadOnlyError-swift.var)

Could not write because the volume is read-only.

### iCloud File Errors

[`NSUbiquitousFileErrorMinimum`](/documentation/Foundation/NSUbiquitousFileErrorMinimum-swift.var)

The minimum error code value that represents an iCloud error.

[`NSUbiquitousFileErrorMaximum`](/documentation/Foundation/NSUbiquitousFileErrorMaximum-swift.var)

The maximum error code value that represents an iCloud error.

[`NSUbiquitousFileNotUploadedDueToQuotaError`](/documentation/Foundation/NSUbiquitousFileNotUploadedDueToQuotaError-swift.var)

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

[`NSUbiquitousFileUbiquityServerNotAvailable`](/documentation/Foundation/NSUbiquitousFileUbiquityServerNotAvailable-swift.var)

A failure to connect to the iCloud servers.

[`NSUbiquitousFileUnavailableError`](/documentation/Foundation/NSUbiquitousFileUnavailableError-swift.var)

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

### Property List Errors

[`NSPropertyListErrorMinimum`](/documentation/Foundation/NSPropertyListErrorMinimum-swift.var)

The start of the range of error codes reserved for property list errors.

[`NSPropertyListErrorMaximum`](/documentation/Foundation/NSPropertyListErrorMaximum-swift.var)

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

[`NSPropertyListReadCorruptError`](/documentation/Foundation/NSPropertyListReadCorruptError-swift.var)

Parsing of the property list failed.

[`NSPropertyListReadStreamError`](/documentation/Foundation/NSPropertyListReadStreamError-swift.var)

Reading of the property list failed.

[`NSPropertyListReadUnknownVersionError`](/documentation/Foundation/NSPropertyListReadUnknownVersionError-swift.var)

The version number of the property list cannot be determined.

[`NSPropertyListWriteInvalidError`](/documentation/Foundation/NSPropertyListWriteInvalidError-swift.var)

Writing failed because of an invalid property list object, or an invalid property list type was specified.

[`NSPropertyListWriteStreamError`](/documentation/Foundation/NSPropertyListWriteStreamError-swift.var)

Writing to the property list failed.

### User Activity Errors

[`NSUserActivityErrorMinimum`](/documentation/Foundation/NSUserActivityErrorMinimum-swift.var)

The start of the range of error codes reserved for user activity errors.

[`NSUserActivityErrorMaximum`](/documentation/Foundation/NSUserActivityErrorMaximum-swift.var)

The end of the range of error codes reserved for user activity errors.

[`NSUserActivityConnectionUnavailableError`](/documentation/Foundation/NSUserActivityConnectionUnavailableError-swift.var)

The user activity couldn’t be continued because a required connection wasn’t available.

[`NSUserActivityHandoffFailedError`](/documentation/Foundation/NSUserActivityHandoffFailedError-swift.var)

The data for the user activity wasn’t available.

[`NSUserActivityHandoffUserInfoTooLargeError`](/documentation/Foundation/NSUserActivityHandoffUserInfoTooLargeError-swift.var)

The user info dictionary was too large to receive.

[`NSUserActivityRemoteApplicationTimedOutError`](/documentation/Foundation/NSUserActivityRemoteApplicationTimedOutError-swift.var)

The remote application failed to send data within the specified time.

### Validation Errors

[`NSValidationErrorMinimum`](/documentation/Foundation/NSValidationErrorMinimum-swift.var)

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

[`NSValidationErrorMaximum`](/documentation/Foundation/NSValidationErrorMaximum-swift.var)

The end of the range of error codes reserved for validation errors.

### XPC Errors

[`NSXPCConnectionErrorMinimum`](/documentation/Foundation/NSXPCConnectionErrorMinimum-swift.var)

The lower bounds of XPC connection error code values.

[`NSXPCConnectionErrorMaximum`](/documentation/Foundation/NSXPCConnectionErrorMaximum-swift.var)

The upper bounds of XPC connection error code values.

[`NSXPCConnectionInterrupted`](/documentation/Foundation/NSXPCConnectionInterrupted-swift.var)

The XPC connection was interrupted.

[`NSXPCConnectionInvalid`](/documentation/Foundation/NSXPCConnectionInvalid-swift.var)

The XPC connection was invalid.

[`NSXPCConnectionReplyInvalid`](/documentation/Foundation/NSXPCConnectionReplyInvalid-swift.var)

The XPC connection reply was invalid.

### URL Errors

[`NSURLErrorAppTransportSecurityRequiresSecureConnection`](/documentation/Foundation/NSURLErrorAppTransportSecurityRequiresSecureConnection-swift.var)

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

[`NSURLErrorBackgroundSessionInUseByAnotherProcess`](/documentation/Foundation/NSURLErrorBackgroundSessionInUseByAnotherProcess-swift.var)

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

[`NSURLErrorBackgroundSessionRequiresSharedContainer`](/documentation/Foundation/NSURLErrorBackgroundSessionRequiresSharedContainer-swift.var)

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

[`NSURLErrorBackgroundSessionWasDisconnected`](/documentation/Foundation/NSURLErrorBackgroundSessionWasDisconnected-swift.var)

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

[`NSURLErrorBadServerResponse`](/documentation/Foundation/NSURLErrorBadServerResponse-swift.var)

The URL Loading System received bad data from the server.

[`NSURLErrorBadURL`](/documentation/Foundation/NSURLErrorBadURL-swift.var)

A malformed URL prevented a URL request from being initiated.

[`NSURLErrorCallIsActive`](/documentation/Foundation/NSURLErrorCallIsActive-swift.var)

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.

[`NSURLErrorCancelled`](/documentation/Foundation/NSURLErrorCancelled-swift.var)

An asynchronous load has been canceled.

[`NSURLErrorCannotCloseFile`](/documentation/Foundation/NSURLErrorCannotCloseFile-swift.var)

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

[`NSURLErrorCannotConnectToHost`](/documentation/Foundation/NSURLErrorCannotConnectToHost-swift.var)

An attempt to connect to a host failed.

[`NSURLErrorCannotCreateFile`](/documentation/Foundation/NSURLErrorCannotCreateFile-swift.var)

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

[`NSURLErrorCannotDecodeContentData`](/documentation/Foundation/NSURLErrorCannotDecodeContentData-swift.var)

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

[`NSURLErrorCannotDecodeRawData`](/documentation/Foundation/NSURLErrorCannotDecodeRawData-swift.var)

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

[`NSURLErrorCannotFindHost`](/documentation/Foundation/NSURLErrorCannotFindHost-swift.var)

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

[`NSURLErrorCannotLoadFromNetwork`](/documentation/Foundation/NSURLErrorCannotLoadFromNetwork-swift.var)

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

[`NSURLErrorCannotMoveFile`](/documentation/Foundation/NSURLErrorCannotMoveFile-swift.var)

A downloaded file on disk couldn’t be moved.

[`NSURLErrorCannotOpenFile`](/documentation/Foundation/NSURLErrorCannotOpenFile-swift.var)

A downloaded file on disk couldn’t be opened.

[`NSURLErrorCannotParseResponse`](/documentation/Foundation/NSURLErrorCannotParseResponse-swift.var)

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

[`NSURLErrorCannotRemoveFile`](/documentation/Foundation/NSURLErrorCannotRemoveFile-swift.var)

A downloaded file couldn’t be removed from disk.

[`NSURLErrorCannotWriteToFile`](/documentation/Foundation/NSURLErrorCannotWriteToFile-swift.var)

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

[`NSURLErrorClientCertificateRejected`](/documentation/Foundation/NSURLErrorClientCertificateRejected-swift.var)

A server certificate was rejected.

[`NSURLErrorClientCertificateRequired`](/documentation/Foundation/NSURLErrorClientCertificateRequired-swift.var)

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

[`NSURLErrorDNSLookupFailed`](/documentation/Foundation/NSURLErrorDNSLookupFailed-swift.var)

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

[`NSURLErrorDataLengthExceedsMaximum`](/documentation/Foundation/NSURLErrorDataLengthExceedsMaximum-swift.var)

The length of the resource data exceeded the maximum allowed.

[`NSURLErrorDataNotAllowed`](/documentation/Foundation/NSURLErrorDataNotAllowed-swift.var)

The cellular network disallowed a connection.

[`NSURLErrorDownloadDecodingFailedMidStream`](/documentation/Foundation/NSURLErrorDownloadDecodingFailedMidStream-swift.var)

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

[`NSURLErrorDownloadDecodingFailedToComplete`](/documentation/Foundation/NSURLErrorDownloadDecodingFailedToComplete-swift.var)

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

[`NSURLErrorFileDoesNotExist`](/documentation/Foundation/NSURLErrorFileDoesNotExist-swift.var)

The specified file doesn’t exist.

[`NSURLErrorFileIsDirectory`](/documentation/Foundation/NSURLErrorFileIsDirectory-swift.var)

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

[`NSURLErrorFileOutsideSafeArea`](/documentation/Foundation/NSURLErrorFileOutsideSafeArea-swift.var)

An internal file operation failed.

[`NSURLErrorHTTPTooManyRedirects`](/documentation/Foundation/NSURLErrorHTTPTooManyRedirects-swift.var)

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

[`NSURLErrorInternationalRoamingOff`](/documentation/Foundation/NSURLErrorInternationalRoamingOff-swift.var)

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

[`NSURLErrorNetworkConnectionLost`](/documentation/Foundation/NSURLErrorNetworkConnectionLost-swift.var)

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

[`NSURLErrorNoPermissionsToReadFile`](/documentation/Foundation/NSURLErrorNoPermissionsToReadFile-swift.var)

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

[`NSURLErrorNotConnectedToInternet`](/documentation/Foundation/NSURLErrorNotConnectedToInternet-swift.var)

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

[`NSURLErrorRedirectToNonExistentLocation`](/documentation/Foundation/NSURLErrorRedirectToNonExistentLocation-swift.var)

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

[`NSURLErrorRequestBodyStreamExhausted`](/documentation/Foundation/NSURLErrorRequestBodyStreamExhausted-swift.var)

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

[`NSURLErrorResourceUnavailable`](/documentation/Foundation/NSURLErrorResourceUnavailable-swift.var)

A requested resource couldn’t be retrieved.

[`NSURLErrorSecureConnectionFailed`](/documentation/Foundation/NSURLErrorSecureConnectionFailed-swift.var)

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

[`NSURLErrorServerCertificateHasBadDate`](/documentation/Foundation/NSURLErrorServerCertificateHasBadDate-swift.var)

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

[`NSURLErrorServerCertificateHasUnknownRoot`](/documentation/Foundation/NSURLErrorServerCertificateHasUnknownRoot-swift.var)

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

[`NSURLErrorServerCertificateNotYetValid`](/documentation/Foundation/NSURLErrorServerCertificateNotYetValid-swift.var)

A server certificate isn’t valid yet.

[`NSURLErrorServerCertificateUntrusted`](/documentation/Foundation/NSURLErrorServerCertificateUntrusted-swift.var)

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

[`NSURLErrorTimedOut`](/documentation/Foundation/NSURLErrorTimedOut-swift.var)

An asynchronous operation timed out.

[`NSURLErrorUnknown`](/documentation/Foundation/NSURLErrorUnknown-swift.var)

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

[`NSURLErrorUnsupportedURL`](/documentation/Foundation/NSURLErrorUnsupportedURL-swift.var)

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

[`NSURLErrorUserAuthenticationRequired`](/documentation/Foundation/NSURLErrorUserAuthenticationRequired-swift.var)

Authentication was required to access a resource.

[`NSURLErrorUserCancelledAuthentication`](/documentation/Foundation/NSURLErrorUserCancelledAuthentication-swift.var)

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

[`NSURLErrorZeroByteResource`](/documentation/Foundation/NSURLErrorZeroByteResource-swift.var)

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

### Miscellaneous Errors

[`NSFeatureUnsupportedError`](/documentation/Foundation/NSFeatureUnsupportedError-swift.var)

The feature isn’t supported, because the file system lacks the feature, or required libraries are missing, or other similar reasons.

[`NSKeyValueValidationError`](/documentation/Foundation/NSKeyValueValidationError-swift.var)

A key-value coding validation error.

### Bundle Errors

[`NSBundleErrorMinimum`](/documentation/Foundation/NSBundleErrorMinimum-c.enum.case)

The start of the range of error codes reserved for bundle errors.

[`NSBundleErrorMaximum`](/documentation/Foundation/NSBundleErrorMaximum-c.enum.case)

The end of the range of error codes reserved for bundle errors.

[`NSBundleOnDemandResourceExceededMaximumSizeError`](/documentation/Foundation/NSBundleOnDemandResourceExceededMaximumSizeError-c.enum.case)

The application exceeded the amount of on-demand resources content in use at one time.

[`NSBundleOnDemandResourceInvalidTagError`](/documentation/Foundation/NSBundleOnDemandResourceInvalidTagError-c.enum.case)

The application specified a tag that the system couldn’t find in the application tag manifest.

[`NSBundleOnDemandResourceOutOfSpaceError`](/documentation/Foundation/NSBundleOnDemandResourceOutOfSpaceError-c.enum.case)

Insufficient space available to download the requested On Demand Resources.

### Cancellation

[`NSUserCancelledError`](/documentation/Foundation/NSUserCancelledError-c.enum.case)

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

### Cloud-Sharing Errors

[`NSCloudSharingErrorMinimum`](/documentation/Foundation/NSCloudSharingErrorMinimum-c.enum.case)

The start of the range of error codes reserved for cloud-sharing errors.

[`NSCloudSharingErrorMaximum`](/documentation/Foundation/NSCloudSharingErrorMaximum-c.enum.case)

The end of the range of error codes reserved for cloud-sharing errors.

[`NSCloudSharingConflictError`](/documentation/Foundation/NSCloudSharingConflictError-c.enum.case)

A conflict occurred during an attempt to save changes.

[`NSCloudSharingNetworkFailureError`](/documentation/Foundation/NSCloudSharingNetworkFailureError-c.enum.case)

Sharing failed due to a network failure.

[`NSCloudSharingNoPermissionError`](/documentation/Foundation/NSCloudSharingNoPermissionError-c.enum.case)

The current user doesn’t have permission to perform the requested actions.

[`NSCloudSharingOtherError`](/documentation/Foundation/NSCloudSharingOtherError-c.enum.case)

An otherwise unspecified cloud-sharing error occurred.

[`NSCloudSharingQuotaExceededError`](/documentation/Foundation/NSCloudSharingQuotaExceededError-c.enum.case)

The user doesn’t have enough storage space available to share the requested items.

[`NSCloudSharingTooManyParticipantsError`](/documentation/Foundation/NSCloudSharingTooManyParticipantsError-c.enum.case)

Additional participants couldn’t be added to the share, because the limit was reached.

### Coder Errors

[`NSCoderErrorMinimum`](/documentation/Foundation/NSCoderErrorMinimum-c.enum.case)

The start of the range of error codes reserved for coder errors.

[`NSCoderErrorMaximum`](/documentation/Foundation/NSCoderErrorMaximum-c.enum.case)

The end of the range of error codes reserved for coder errors.

[`NSCoderValueNotFoundError`](/documentation/Foundation/NSCoderValueNotFoundError-c.enum.case)

The requested data wasn’t found.

[`NSCoderReadCorruptError`](/documentation/Foundation/NSCoderReadCorruptError-c.enum.case)

Decoding failed due to corrupt data.

[`NSCoderInvalidValueError`](/documentation/Foundation/NSCoderInvalidValueError-c.enum.case)

Data wasn’t valid to encode.

### Executable Errors

[`NSExecutableErrorMinimum`](/documentation/Foundation/NSExecutableErrorMinimum-c.enum.case)

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

[`NSExecutableErrorMaximum`](/documentation/Foundation/NSExecutableErrorMaximum-c.enum.case)

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

[`NSExecutableArchitectureMismatchError`](/documentation/Foundation/NSExecutableArchitectureMismatchError-c.enum.case)

The executable doesn’t provide an architecture compatible with the current process.

[`NSExecutableLinkError`](/documentation/Foundation/NSExecutableLinkError-c.enum.case)

The executable failed due to linking issues.

[`NSExecutableLoadError`](/documentation/Foundation/NSExecutableLoadError-c.enum.case)

Executable cannot be loaded for an otherwise-unspecified reason.

[`NSExecutableNotLoadableError`](/documentation/Foundation/NSExecutableNotLoadableError-c.enum.case)

The executable type isn’t loadable in the current process.

[`NSExecutableRuntimeMismatchError`](/documentation/Foundation/NSExecutableRuntimeMismatchError-c.enum.case)

The executable has Objective-C runtime information that’s incompatible with the current process.

### Formatting Errors

[`NSFormattingErrorMinimum`](/documentation/Foundation/NSFormattingErrorMinimum-c.enum.case)

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

[`NSFormattingErrorMaximum`](/documentation/Foundation/NSFormattingErrorMaximum-c.enum.case)

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

[`NSFormattingError`](/documentation/Foundation/NSFormattingError-c.enum.case)

A formatter couldn’t generate a string for an object, or parse a string into an object.

### File Errors

[`NSFileErrorMinimum`](/documentation/Foundation/NSFileErrorMinimum-c.enum.case)

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

[`NSFileErrorMaximum`](/documentation/Foundation/NSFileErrorMaximum-c.enum.case)

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

[`NSFileLockingError`](/documentation/Foundation/NSFileLockingError-c.enum.case)

The file could not be locked.

[`NSFileManagerUnmountBusyError`](/documentation/Foundation/NSFileManagerUnmountBusyError-c.enum.case)

The volume couldn’t be unmounted because it’s in use.

[`NSFileManagerUnmountUnknownError`](/documentation/Foundation/NSFileManagerUnmountUnknownError-c.enum.case)

The volume couldn’t be unmounted, for unknown reasons.

[`NSFileNoSuchFileError`](/documentation/Foundation/NSFileNoSuchFileError-c.enum.case)

A filesystem operation was attempted on a non-existent file.

### File Reading Errors

[`NSFileReadCorruptFileError`](/documentation/Foundation/NSFileReadCorruptFileError-c.enum.case)

Could not read because of a corrupted file, bad format, or similar reason.

[`NSFileReadInapplicableStringEncodingError`](/documentation/Foundation/NSFileReadInapplicableStringEncodingError-c.enum.case)

Could not read because the string encoding wasn’t applicable.

[`NSFileReadInvalidFileNameError`](/documentation/Foundation/NSFileReadInvalidFileNameError-c.enum.case)

Could not read because of an invalid file name.

[`NSFileReadNoPermissionError`](/documentation/Foundation/NSFileReadNoPermissionError-c.enum.case)

Could not read because of a permission problem.

[`NSFileReadNoSuchFileError`](/documentation/Foundation/NSFileReadNoSuchFileError-c.enum.case)

Could not read because no such file was found.

[`NSFileReadTooLargeError`](/documentation/Foundation/NSFileReadTooLargeError-c.enum.case)

Could not read because the specified file was too large.

[`NSFileReadUnknownError`](/documentation/Foundation/NSFileReadUnknownError-c.enum.case)

Could not read, for unknown reasons.

[`NSFileReadUnknownStringEncodingError`](/documentation/Foundation/NSFileReadUnknownStringEncodingError-c.enum.case)

Could not read because the string coding of the file couldn’t be determined.

[`NSFileReadUnsupportedSchemeError`](/documentation/Foundation/NSFileReadUnsupportedSchemeError-c.enum.case)

Could not read because the specified URL scheme is unsupported.

### File Writing Errors

[`NSFileWriteFileExistsError`](/documentation/Foundation/NSFileWriteFileExistsError-c.enum.case)

Could not perform an operation because the destination file already exists.

[`NSFileWriteInapplicableStringEncodingError`](/documentation/Foundation/NSFileWriteInapplicableStringEncodingError-c.enum.case)

Could not write because the string encoding was not applicable.

[`NSFileWriteInvalidFileNameError`](/documentation/Foundation/NSFileWriteInvalidFileNameError-c.enum.case)

Could not write because of an invalid file name.

[`NSFileWriteNoPermissionError`](/documentation/Foundation/NSFileWriteNoPermissionError-c.enum.case)

Could not write because of a permission problem.

[`NSFileWriteOutOfSpaceError`](/documentation/Foundation/NSFileWriteOutOfSpaceError-c.enum.case)

Could not write because of a lack of disk space.

[`NSFileWriteUnknownError`](/documentation/Foundation/NSFileWriteUnknownError-c.enum.case)

Could not write, for unknown reasons.

[`NSFileWriteUnsupportedSchemeError`](/documentation/Foundation/NSFileWriteUnsupportedSchemeError-c.enum.case)

Could not write because the specified URL scheme is unsupported.

[`NSFileWriteVolumeReadOnlyError`](/documentation/Foundation/NSFileWriteVolumeReadOnlyError-c.enum.case)

Could not write because the volume is read-only.

### iCloud File Errors

[`NSUbiquitousFileErrorMinimum`](/documentation/Foundation/NSUbiquitousFileErrorMinimum-c.enum.case)

The minimum error code value that represents an iCloud error.

[`NSUbiquitousFileErrorMaximum`](/documentation/Foundation/NSUbiquitousFileErrorMaximum-c.enum.case)

The maximum error code value that represents an iCloud error.

[`NSUbiquitousFileNotUploadedDueToQuotaError`](/documentation/Foundation/NSUbiquitousFileNotUploadedDueToQuotaError-c.enum.case)

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

[`NSUbiquitousFileUbiquityServerNotAvailable`](/documentation/Foundation/NSUbiquitousFileUbiquityServerNotAvailable-c.enum.case)

A failure to connect to the iCloud servers.

[`NSUbiquitousFileUnavailableError`](/documentation/Foundation/NSUbiquitousFileUnavailableError-c.enum.case)

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

### Property List Errors

[`NSPropertyListErrorMinimum`](/documentation/Foundation/NSPropertyListErrorMinimum-c.enum.case)

The start of the range of error codes reserved for property list errors.

[`NSPropertyListErrorMaximum`](/documentation/Foundation/NSPropertyListErrorMaximum-c.enum.case)

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

[`NSPropertyListReadCorruptError`](/documentation/Foundation/NSPropertyListReadCorruptError-c.enum.case)

Parsing of the property list failed.

[`NSPropertyListReadStreamError`](/documentation/Foundation/NSPropertyListReadStreamError-c.enum.case)

Reading of the property list failed.

[`NSPropertyListReadUnknownVersionError`](/documentation/Foundation/NSPropertyListReadUnknownVersionError-c.enum.case)

The version number of the property list cannot be determined.

[`NSPropertyListWriteInvalidError`](/documentation/Foundation/NSPropertyListWriteInvalidError-c.enum.case)

Writing failed because of an invalid property list object, or an invalid property list type was specified.

[`NSPropertyListWriteStreamError`](/documentation/Foundation/NSPropertyListWriteStreamError-c.enum.case)

Writing to the property list failed.

### User Activity Errors

[`NSUserActivityErrorMinimum`](/documentation/Foundation/NSUserActivityErrorMinimum-c.enum.case)

The start of the range of error codes reserved for user activity errors.

[`NSUserActivityErrorMaximum`](/documentation/Foundation/NSUserActivityErrorMaximum-c.enum.case)

The end of the range of error codes reserved for user activity errors.

[`NSUserActivityConnectionUnavailableError`](/documentation/Foundation/NSUserActivityConnectionUnavailableError-c.enum.case)

The user activity couldn’t be continued because a required connection wasn’t available.

[`NSUserActivityHandoffFailedError`](/documentation/Foundation/NSUserActivityHandoffFailedError-c.enum.case)

The data for the user activity wasn’t available.

[`NSUserActivityHandoffUserInfoTooLargeError`](/documentation/Foundation/NSUserActivityHandoffUserInfoTooLargeError-c.enum.case)

The user info dictionary was too large to receive.

[`NSUserActivityRemoteApplicationTimedOutError`](/documentation/Foundation/NSUserActivityRemoteApplicationTimedOutError-c.enum.case)

The remote application failed to send data within the specified time.

### Validation Errors

[`NSValidationErrorMinimum`](/documentation/Foundation/NSValidationErrorMinimum-c.enum.case)

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

[`NSValidationErrorMaximum`](/documentation/Foundation/NSValidationErrorMaximum-c.enum.case)

The end of the range of error codes reserved for validation errors.

### XPC Errors

[`NSXPCConnectionErrorMinimum`](/documentation/Foundation/NSXPCConnectionErrorMinimum-c.enum.case)

The lower bounds of XPC connection error code values.

[`NSXPCConnectionErrorMaximum`](/documentation/Foundation/NSXPCConnectionErrorMaximum-c.enum.case)

The upper bounds of XPC connection error code values.

[`NSXPCConnectionInterrupted`](/documentation/Foundation/NSXPCConnectionInterrupted-c.enum.case)

The XPC connection was interrupted.

[`NSXPCConnectionInvalid`](/documentation/Foundation/NSXPCConnectionInvalid-c.enum.case)

The XPC connection was invalid.

[`NSXPCConnectionReplyInvalid`](/documentation/Foundation/NSXPCConnectionReplyInvalid-c.enum.case)

The XPC connection reply was invalid.

### URL Errors

[`NSURLErrorAppTransportSecurityRequiresSecureConnection`](/documentation/Foundation/NSURLErrorAppTransportSecurityRequiresSecureConnection-c.enum.case)

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

[`NSURLErrorBackgroundSessionInUseByAnotherProcess`](/documentation/Foundation/NSURLErrorBackgroundSessionInUseByAnotherProcess-c.enum.case)

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

[`NSURLErrorBackgroundSessionRequiresSharedContainer`](/documentation/Foundation/NSURLErrorBackgroundSessionRequiresSharedContainer-c.enum.case)

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

[`NSURLErrorBackgroundSessionWasDisconnected`](/documentation/Foundation/NSURLErrorBackgroundSessionWasDisconnected-c.enum.case)

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

[`NSURLErrorBadServerResponse`](/documentation/Foundation/NSURLErrorBadServerResponse-c.enum.case)

The URL Loading System received bad data from the server.

[`NSURLErrorBadURL`](/documentation/Foundation/NSURLErrorBadURL-c.enum.case)

A malformed URL prevented a URL request from being initiated.

[`NSURLErrorCallIsActive`](/documentation/Foundation/NSURLErrorCallIsActive-c.enum.case)

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.

[`NSURLErrorCancelled`](/documentation/Foundation/NSURLErrorCancelled-c.enum.case)

An asynchronous load has been canceled.

[`NSURLErrorCannotCloseFile`](/documentation/Foundation/NSURLErrorCannotCloseFile-c.enum.case)

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

[`NSURLErrorCannotConnectToHost`](/documentation/Foundation/NSURLErrorCannotConnectToHost-c.enum.case)

An attempt to connect to a host failed.

[`NSURLErrorCannotCreateFile`](/documentation/Foundation/NSURLErrorCannotCreateFile-c.enum.case)

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

[`NSURLErrorCannotDecodeContentData`](/documentation/Foundation/NSURLErrorCannotDecodeContentData-c.enum.case)

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

[`NSURLErrorCannotDecodeRawData`](/documentation/Foundation/NSURLErrorCannotDecodeRawData-c.enum.case)

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

[`NSURLErrorCannotFindHost`](/documentation/Foundation/NSURLErrorCannotFindHost-c.enum.case)

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

[`NSURLErrorCannotLoadFromNetwork`](/documentation/Foundation/NSURLErrorCannotLoadFromNetwork-c.enum.case)

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

[`NSURLErrorCannotMoveFile`](/documentation/Foundation/NSURLErrorCannotMoveFile-c.enum.case)

A downloaded file on disk couldn’t be moved.

[`NSURLErrorCannotOpenFile`](/documentation/Foundation/NSURLErrorCannotOpenFile-c.enum.case)

A downloaded file on disk couldn’t be opened.

[`NSURLErrorCannotParseResponse`](/documentation/Foundation/NSURLErrorCannotParseResponse-c.enum.case)

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

[`NSURLErrorCannotRemoveFile`](/documentation/Foundation/NSURLErrorCannotRemoveFile-c.enum.case)

A downloaded file couldn’t be removed from disk.

[`NSURLErrorCannotWriteToFile`](/documentation/Foundation/NSURLErrorCannotWriteToFile-c.enum.case)

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

[`NSURLErrorClientCertificateRejected`](/documentation/Foundation/NSURLErrorClientCertificateRejected-c.enum.case)

A server certificate was rejected.

[`NSURLErrorClientCertificateRequired`](/documentation/Foundation/NSURLErrorClientCertificateRequired-c.enum.case)

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

[`NSURLErrorDNSLookupFailed`](/documentation/Foundation/NSURLErrorDNSLookupFailed-c.enum.case)

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

[`NSURLErrorDataLengthExceedsMaximum`](/documentation/Foundation/NSURLErrorDataLengthExceedsMaximum-c.enum.case)

The length of the resource data exceeded the maximum allowed.

[`NSURLErrorDataNotAllowed`](/documentation/Foundation/NSURLErrorDataNotAllowed-c.enum.case)

The cellular network disallowed a connection.

[`NSURLErrorDownloadDecodingFailedMidStream`](/documentation/Foundation/NSURLErrorDownloadDecodingFailedMidStream-c.enum.case)

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

[`NSURLErrorDownloadDecodingFailedToComplete`](/documentation/Foundation/NSURLErrorDownloadDecodingFailedToComplete-c.enum.case)

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

[`NSURLErrorFileDoesNotExist`](/documentation/Foundation/NSURLErrorFileDoesNotExist-c.enum.case)

The specified file doesn’t exist.

[`NSURLErrorFileIsDirectory`](/documentation/Foundation/NSURLErrorFileIsDirectory-c.enum.case)

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

[`NSURLErrorFileOutsideSafeArea`](/documentation/Foundation/NSURLErrorFileOutsideSafeArea-c.enum.case)

An internal file operation failed.

[`NSURLErrorHTTPTooManyRedirects`](/documentation/Foundation/NSURLErrorHTTPTooManyRedirects-c.enum.case)

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

[`NSURLErrorInternationalRoamingOff`](/documentation/Foundation/NSURLErrorInternationalRoamingOff-c.enum.case)

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

[`NSURLErrorNetworkConnectionLost`](/documentation/Foundation/NSURLErrorNetworkConnectionLost-c.enum.case)

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

[`NSURLErrorNoPermissionsToReadFile`](/documentation/Foundation/NSURLErrorNoPermissionsToReadFile-c.enum.case)

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

[`NSURLErrorNotConnectedToInternet`](/documentation/Foundation/NSURLErrorNotConnectedToInternet-c.enum.case)

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

[`NSURLErrorRedirectToNonExistentLocation`](/documentation/Foundation/NSURLErrorRedirectToNonExistentLocation-c.enum.case)

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

[`NSURLErrorRequestBodyStreamExhausted`](/documentation/Foundation/NSURLErrorRequestBodyStreamExhausted-c.enum.case)

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

[`NSURLErrorResourceUnavailable`](/documentation/Foundation/NSURLErrorResourceUnavailable-c.enum.case)

A requested resource couldn’t be retrieved.

[`NSURLErrorSecureConnectionFailed`](/documentation/Foundation/NSURLErrorSecureConnectionFailed-c.enum.case)

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

[`NSURLErrorServerCertificateHasBadDate`](/documentation/Foundation/NSURLErrorServerCertificateHasBadDate-c.enum.case)

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

[`NSURLErrorServerCertificateHasUnknownRoot`](/documentation/Foundation/NSURLErrorServerCertificateHasUnknownRoot-c.enum.case)

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

[`NSURLErrorServerCertificateNotYetValid`](/documentation/Foundation/NSURLErrorServerCertificateNotYetValid-c.enum.case)

A server certificate isn’t valid yet.

[`NSURLErrorServerCertificateUntrusted`](/documentation/Foundation/NSURLErrorServerCertificateUntrusted-c.enum.case)

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

[`NSURLErrorTimedOut`](/documentation/Foundation/NSURLErrorTimedOut-c.enum.case)

An asynchronous operation timed out.

[`NSURLErrorUnknown`](/documentation/Foundation/NSURLErrorUnknown-c.enum.case)

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

[`NSURLErrorUnsupportedURL`](/documentation/Foundation/NSURLErrorUnsupportedURL-c.enum.case)

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

[`NSURLErrorUserAuthenticationRequired`](/documentation/Foundation/NSURLErrorUserAuthenticationRequired-c.enum.case)

Authentication was required to access a resource.

[`NSURLErrorUserCancelledAuthentication`](/documentation/Foundation/NSURLErrorUserCancelledAuthentication-c.enum.case)

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

[`NSURLErrorZeroByteResource`](/documentation/Foundation/NSURLErrorZeroByteResource-c.enum.case)

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

### Miscellaneous Errors

[`NSFeatureUnsupportedError`](/documentation/Foundation/NSFeatureUnsupportedError-c.enum.case)

The feature isn’t supported, because the file system lacks the feature, or required libraries are missing, or other similar reasons.

[`NSKeyValueValidationError`](/documentation/Foundation/NSKeyValueValidationError-c.enum.case)

A key-value coding validation error.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)