---
title: "sessionFailed(_:error:)"
framework: mediadevice
role: symbol
role_heading: Instance Method
path: "mediadevice/mediadeviceroutingmanager/sessionfailed(_:error:)"
---

# sessionFailed(_:error:)

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

## Declaration

```swift
@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

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