<!--
{
  "availability" : [
    "iOS: 10.3.0 -",
    "iPadOS: 10.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.4 -",
    "tvOS: 10.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVContentKeySessionDelegate/contentKeySession(_:contentKeyRequest:didFailWithError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(pl)AVContentKeySessionDelegate(im)contentKeySession:contentKeyRequest:didFailWithError:"
  },
  "title" : "contentKeySession(_:contentKeyRequest:didFailWithError:)"
}
-->

# contentKeySession(_:contentKeyRequest:didFailWithError:)

Tells the receiver that the content key request failed.

```
optional func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: any Error)
```

## Parameters

`session`

The content key session that initiated the content key request.

`keyRequest`

The content key request that failed.

`err`

An instance of <doc://com.apple.documentation/documentation/Foundation/NSError> that describes the failure that occurred.

## Discussion

---

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)