<!--
{
  "documentType" : "article",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/error-dictionary-keys",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Error Dictionary Keys"
}
-->

# Error Dictionary Keys

Networking-related keys that may be available in a `CFErrorRef` object’s `userInfo` dictionary.

## Discussion

Many network functions return `CFErrorRef` objects. When the error object’s domain is `kCFErrorDomainCFNetwork`, you can query the object for additional information.

For example:

```objc
if (CFEqual(CFErrorGetDomain(err), kCFErrorDomainCFNetwork) && CFErrorGetCode(err) == kCFHostErrorUnknown) {
 
    CFDictionaryRef userInfo = CFErrorCopyUserInfo(err);
 
    CFNumberRef number = (CFNumberRef) CFDictionaryGetValue(userInfo, kCFGetAddrInfoFailureKey);
 
    ...
 
    CFRelease(userInfo);
}
```

## Topics

### Constants

[`let kCFURLErrorFailingURLErrorKey: CFString`](/documentation/CFNetwork/kCFURLErrorFailingURLErrorKey)

The URL that caused the load to fail as a `CFURLRef` object.

[`let kCFURLErrorFailingURLStringErrorKey: CFString`](/documentation/CFNetwork/kCFURLErrorFailingURLStringErrorKey)

The URL that caused the load to fail as a `CFStringRef` object.

[`let kCFGetAddrInfoFailureKey: CFString`](/documentation/CFNetwork/kCFGetAddrInfoFailureKey)

[`let kCFSOCKSStatusCodeKey: CFString`](/documentation/CFNetwork/kCFSOCKSStatusCodeKey)

[`let kCFSOCKSVersionKey: CFString`](/documentation/CFNetwork/kCFSOCKSVersionKey)

[`let kCFSOCKSNegotiationMethodKey: CFString`](/documentation/CFNetwork/kCFSOCKSNegotiationMethodKey)

[`let kCFDNSServiceFailureKey: CFString`](/documentation/CFNetwork/kCFDNSServiceFailureKey)

[`let kCFFTPStatusCodeKey: CFString`](/documentation/CFNetwork/kCFFTPStatusCodeKey)



---

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)