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

# error

An error that caused a failure.

## Declaration

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

## Discussion

Discussion By default, this value is nil. If a player reaches a AVPlayer.Status.failed, the system populates this value with an error that describes the failure.

## See Also

### Determining player readiness

- [status](avfoundation/avplayer/status-swift.property.md)
- [AVPlayer.Status](avfoundation/avplayer/status-swift.enum.md)
