---
title: "discoveryFailed(_:)"
framework: mediadevice
role: symbol
role_heading: Instance Method
path: "mediadevice/mediadeviceroutingmanager/discoveryfailed(_:)"
---

# discoveryFailed(_:)

Reports a discovery failure to the system, indicating that the extension was unable to search for devices.

## Declaration

```swift
@MainActor final func discoveryFailed(_ error: MediaDeviceError)
```

## Parameters

- `error`: The error describing why discovery failed.

## Mentioned in

Creating a media device extension

## Discussion

Discussion Call this function when discovery is prevented in an unexpected way. Do not call this function when devices are simply not discovered.
