<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFErrorCopyDescription(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFErrorCopyDescription"
  },
  "title" : "CFErrorCopyDescription(_:)"
}
-->

# CFErrorCopyDescription(_:)

Returns a human-presentable description for a given error.

```
func CFErrorCopyDescription(_ err: CFError!) -> CFString!
```

## Parameters

`err`

The [`CFError`](/documentation/CoreFoundation/CFError) to examine. If this is not a valid [`CFError`](/documentation/CoreFoundation/CFError), the behavior is undefined.

## Return Value

A localized, human-presentable description of `err`. This function never returns `NULL`. Ownership follows the [The Create Rule](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029).

## Discussion

This is a complete sentence or two which says what failed and why it failed. The structure of the description depends on the details provided in the user info dictionary. The rules for computing the return value are as follows:

1. If the value in the user info dictionary for [`kCFErrorLocalizedDescriptionKey`](/documentation/CoreFoundation/kCFErrorLocalizedDescriptionKey) is not `NULL`, it returns that value as-is.
2. If the value in the user info dictionary for [`kCFErrorLocalizedFailureReasonKey`](/documentation/CoreFoundation/kCFErrorLocalizedFailureReasonKey) is not `NULL`, there will be an error generated from that.

The description is something like: “Operation could not be completed. “ + `kCFErrorLocalizedFailureReasonKey`
3. Generate a user-presentable string from [`kCFErrorDescriptionKey`](/documentation/CoreFoundation/kCFErrorDescriptionKey), the domain, and code.

The description is something like: “Operation could not be completed. Error domain/code occurred. “ or “Operation could not be completed. “ + `kCFErrorDescriptionKey` + “ (Error domain/code)”

Toll-free bridged instances of <doc://com.apple.documentation/documentation/Foundation/NSError> might provide additional behaviors for manufacturing a description string.

You should not depend on the exact contents or format of the returned string, as it might change in different releases of the operating system.

When you create a [`CFError`](/documentation/CoreFoundation/CFError), you should try to make sure the return value is human-presentable and localized by providing a value for [`kCFErrorLocalizedDescriptionKey`](/documentation/CoreFoundation/kCFErrorLocalizedDescriptionKey) in the user info dictionary.

---

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)