<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaDeviceRoutingManager/sessionFailed(_:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0aB14RoutingManagerC13sessionFailed_5erroryAA0A13OutputSessionC_AA0aB5ErrorVtF"
  },
  "title" : "sessionFailed(_:error:)"
}
-->

# sessionFailed(_:error:)

Reports an unrecoverable session error to the system so it can end the session and inform the user.

```
@MainActor final func sessionFailed(_ session: MediaOutputSession, error: MediaDeviceError)
```

## Parameters

`session`

The session associated with the failure.

`error`

The error that occurred during the session.

## Discussion

Call this function when an unrecoverable error is encountered during the session.

---

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)