Function: toPlayerError()
function toPlayerError(thrown: unknown, uri?: string): PlayerError;
Defined in: packages/player/src/errors.ts:422
Map anything thrown by the native MpvClient (or by this library) onto the
typed PlayerError taxonomy.
Native tags every message it throws — [mpv:disposed],
[mpv:invalid-state], [mpv:unsupported], [mpv:<errno>] (see
docs/specs/player-core.md §2.5) — and this function is the only place that
knows those tags.
Parameters
| Parameter | Type | Description |
|---|---|---|
thrown | unknown | The value caught from a native call or a rejected promise. |
uri? | string | The source URI in play at the time, if any. Used to tell a network failure apart from a local load failure. |
Returns
A typed error; never throws, never returns undefined.