# Error

Media error state and actions for the player store

Tracks media errors.

## Import

```ts
import { errorFeature } from '@videojs/html';
```

The `audioFeatures`, `liveAudioFeatures`, `liveVideoFeatures`, and `videoFeatures` [feature bundles](../../guides/presets.md) include this feature.

## API Reference

### State

| Property | Type | Description |
| --- | --- | --- |
| `error` | `{ code: number; message: string } \| null` | The current media error, or null if none. |

### Actions

| Action | Type | Description |
| --- | --- | --- |
| `dismissError` | `() => void` | Dismiss the current error by clearing it. |

### Selector

Pass `selectError` to [`PlayerController`](./player-controller.md) to subscribe to error state. Returns `undefined` if the error feature is not configured.

**error-display.ts**

```ts
import { createPlayer, UIElement, selectError } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';

const { PlayerController } = createPlayer({ features: videoFeatures });

class ErrorDisplay extends UIElement {
  readonly #error = new PlayerController(this, selectError);
}
```