Function: clearPlayerError()
function clearPlayerError(state: PlayerState): PlayerState;
Defined in: packages/player/src/state.ts:1188
Drop a settled error on request, leaving every other field alone.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | PlayerState | The snapshot to clear. |
Returns
A new snapshot with no error and status: 'idle', or state
unchanged when there was nothing to clear.
Remarks
This is the deliberate-dismissal counterpart to the three automatic clears documented on PlayerState.error; it exists because those all require something to happen, and the one error that sticks forever is the one after which nothing does.
status must move too, or the snapshot would violate its own invariant
("error present iff status === 'error'"). It moves to 'idle' rather
than to a re-derived value because 'error' is a sticky terminal status
— the reducer only leaves it on a startFile/playbackRestart/stop, and if
any of those had happened there would be no error left to clear. 'idle' is
the other terminal, and it is what the core genuinely is: nothing playing,
nothing loading.
Clearing changes state only. No event is suppressed, replayed or undone:
the error event fired when the failure happened and is already in the app's
logs. Dismissing a banner is not the same as the failure not having occurred,
and this function is careful not to conflate them.