<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaDeviceError",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0aB5ErrorV"
  },
  "title" : "MediaDeviceError"
}
-->

# MediaDeviceError

An error returned by MediaDeviceExtension operations.

```
struct MediaDeviceError
```

## Topics

### Initializers

[`init(MediaDeviceError.Code)`](/documentation/MediaDevice/MediaDeviceError/init(_:))

Creates an error with the specified error code.

### Instance Properties

[`let code: MediaDeviceError.Code`](/documentation/MediaDevice/MediaDeviceError/code-swift.property)

The error code for this error.

[`var errorDescription: String?`](/documentation/MediaDevice/MediaDeviceError/errorDescription)

A localized description of the error.

[`var failureReason: String?`](/documentation/MediaDevice/MediaDeviceError/failureReason)

A localized explanation of the reason for the error.

[`var helpAnchor: String?`](/documentation/MediaDevice/MediaDeviceError/helpAnchor)

A localized help anchor for the error.

[`var recoverySuggestion: String?`](/documentation/MediaDevice/MediaDeviceError/recoverySuggestion)

A localized suggestion for how to recover from the error.

### Enumerations

[`enum Code`](/documentation/MediaDevice/MediaDeviceError/Code-swift.enum)

Error codes for media device operations.

## Relationships

### Conforms To

[`LocalizedError`](/documentation/Foundation/LocalizedError)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Error`](/documentation/Swift/Error)

---

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)