Skip to main content

Function: isRetryableErrno()

function isRetryableErrno(errno: number | undefined): boolean;

Defined in: packages/player/src/errors.ts:258

Whether a bare MPV_ERROR_* number describes a condition that could clear on its own — the code: 'mpv' half of Retryable.

Parameters

ParameterTypeDescription
errnonumber | undefinedThe mpv error number, or undefined when the failure carried none (an untagged native throw). undefined is false: an error this layer could not even attribute to mpv is not evidence of a transient condition.

Returns

boolean

Remarks

The table is short because almost every MPV_ERROR_* is a statement about the call, not about the world — a bad option name, a property that does not exist, a malformed command. Repeating those runs the same code with the same arguments and reaches the same line of mpv.

errnoMPV_ERROR_*retryablereasoning
-14AO_INIT_FAILEDtruethe audio device is a shared, exclusive resource. A phone call, another app taking exclusive output, or a route change landing mid-open makes the same open fail now and succeed a moment later. This is the one mpv errno whose cause is outside the process.
-1 … -12EVENT_QUEUE_FULLCOMMANDfalseall argument/state faults: the same call fails identically
-13, -16LOADING_FAILED, NOTHING_TO_PLAYn/anever reach here — fromErrno maps them to network/load-failed first
-15VO_INIT_FAILEDfalsethe audio core never opens a video output (vid=no), so this cannot be a transient device race the way -14 is
-17UNKNOWN_FORMATn/amapped to unsupported-format
-18, -19UNSUPPORTED, NOT_IMPLEMENTEDn/amapped to unsupported
-20GENERICfalsempv's catch-all. "Unclassified" is not "transient", and guessing otherwise would make every unknown failure retry twice

Anything mpv adds in a future release falls to false for the same reason as GENERIC: an unknown condition is not evidence of a recoverable one.