---
title: error
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avplayeritem/error
---

# error

The error that caused the player item to fail.

## Declaration

```swift
nonisolated var error: (any Error)? { get }
```

## Discussion

Discussion The value of this property is an error that describes what caused the player item to no longer be able to be played. If the receiver’s status is not AVPlayerItem.Status.failed, the value of this property is nil.

## See Also

### Determining readiness

- [status](avfoundation/avplayeritem/status-swift.property.md)
- [AVPlayerItem.Status](avfoundation/avplayeritem/status-swift.enum.md)
