# ErrorState

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/ErrorState.kt+class:androidx.media3.ui.compose.state.ErrorState)


```
@UnstableApi
class ErrorState
```

<br />

*** ** * ** ***

State holder that tracks the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlayerError()` by listening to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#EVENT_PLAYER_ERROR()` and `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#EVENT_PLAYBACK_STATE_CHANGED()`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState#ErrorState(androidx.media3.common.Player)(player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?)` |

| ### Public functions |
|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-nothing/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState#observe()()` Subscribes to updates from `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events` to update the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState#error()` state. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException?` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState#error()` |

## Public constructors

### ErrorState

```
ErrorState(player: Player?)
```

## Public functions

### observe

```
suspend fun observe(): Nothing?
```

Subscribes to updates from `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events` to update the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState#error()` state.

## Public properties

### error

```
val error: PlaybackException?
```