<!--
{
  "documentType" : "article",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/error-domains",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Error domains"
}
-->

# Error domains

These constants define domains for CFError objects.

## Discussion

The value of “code” will correspond to preexisting values in these domains.

## Topics

### Constants

[`let kCFErrorDomainPOSIX: CFErrorDomain!`](/documentation/CoreFoundation/kCFErrorDomainPOSIX)

A constant that specified the POSIX domain.

[`let kCFErrorDomainOSStatus: CFErrorDomain!`](/documentation/CoreFoundation/kCFErrorDomainOSStatus)

A constant that specified the OS domain.

[`let kCFErrorDomainMach: CFErrorDomain!`](/documentation/CoreFoundation/kCFErrorDomainMach)

A constant that specified the Mach domain.

[`let kCFErrorDomainCocoa: CFErrorDomain!`](/documentation/CoreFoundation/kCFErrorDomainCocoa)

A constant that specified the Cocoa domain.



---

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)