---
url: https://docs.moqtail.dev/ts/api/player/classes/PlayerError.md
---
# Class: PlayerError

The single error type of the player module. `element` names the element that
raised it, when there is one.

## Extends

* `Error`

## Constructors

### Constructor

> **new PlayerError**(`code`, `message`, `options?`): `PlayerError`

#### Parameters

##### code

[`PlayerErrorCode`](../type-aliases/PlayerErrorCode.md)

##### message

`string`

##### options?

###### cause?

`unknown`

###### element?

`string`

#### Returns

`PlayerError`

#### Overrides

`Error.constructor`

## Properties

### category

> `readonly` **category**: [`PlayerErrorCategory`](../type-aliases/PlayerErrorCategory.md)

***

### code

> `readonly` **code**: [`PlayerErrorCode`](../type-aliases/PlayerErrorCode.md)

***

### element?

> `readonly` `optional` **element?**: `string`
