Structure
CocoaError
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
Describes errors within the Cocoa error domain, including errors that Foundation throws.
struct CocoaError
Topics
Structures
struct CodeThe error code itself.
Initializers
Instance Properties
let code: CocoaError.Codevar filePath: String?The file path associated with the error, if any.var isCoderError: Boolvar isExecutableError: Boolvar isFileError: Boolvar isFormattingError: Boolvar isPropertyListError: Boolvar isValidationError: Boolvar stringEncoding: String.Encoding?The string encoding associated with this error, if any.var underlying: (any Error)?The underlying error behind this error, if any.var underlyingErrors: [any Error]A list of underlying errors, if any. It includes the values of both NSUnderlyingErrorKey and NSMultipleUnderlyingErrorsKey. If there are no underlying errors, returns an empty array.var url: URL?The URL associated with this error, if any.let userInfo: [String : Any]
Type Properties
static var errorDomain: Stringstatic var executableArchitectureMismatch: CocoaError.Codestatic var executableLink: CocoaError.Codestatic var executableLoad: CocoaError.Codestatic var executableNotLoadable: CocoaError.Codestatic var executableRuntimeMismatch: CocoaError.Codestatic var featureUnsupported: CocoaError.Codestatic var fileLocking: CocoaError.Codestatic var fileManagerUnmountBusy: CocoaError.Codestatic var fileManagerUnmountUnknown: CocoaError.Codestatic var fileNoSuchFile: CocoaError.Codestatic var fileReadCorruptFile: CocoaError.Codestatic var fileReadInapplicableStringEncoding: CocoaError.Codestatic var fileReadInvalidFileName: CocoaError.Codestatic var fileReadNoPermission: CocoaError.Codestatic var fileReadNoSuchFile: CocoaError.Codestatic var fileReadTooLarge: CocoaError.Codestatic var fileReadUnknown: CocoaError.Codestatic var fileReadUnknownStringEncoding: CocoaError.Codestatic var fileReadUnsupportedScheme: CocoaError.Codestatic var fileWriteFileExists: CocoaError.Codestatic var fileWriteInapplicableStringEncoding: CocoaError.Codestatic var fileWriteInvalidFileName: CocoaError.Codestatic var fileWriteNoPermission: CocoaError.Codestatic var fileWriteOutOfSpace: CocoaError.Codestatic var fileWriteUnknown: CocoaError.Codestatic var fileWriteUnsupportedScheme: CocoaError.Codestatic var fileWriteVolumeReadOnly: CocoaError.Codestatic var formatting: CocoaError.Codestatic var keyValueValidation: CocoaError.Codestatic var propertyListReadCorrupt: CocoaError.Codestatic var propertyListReadStream: CocoaError.Codestatic var propertyListReadUnknownVersion: CocoaError.Codestatic var propertyListWriteInvalid: CocoaError.Codestatic var propertyListWriteStream: CocoaError.Codestatic var userCancelled: CocoaError.Code
Type Methods
Relationships
Conforms To
Foundation.CustomNSErrorSwift.CustomStringConvertibleSwift.EquatableSwift.ErrorSwift.HashableSwift.SendableSwift.SendableMetatype