Function: getSvtaErrorCategory()
ts
function getSvtaErrorCategory(code): SvtaErrorCategory | undefined;Defined in: getSvtaErrorCategory.ts:17
Get the SvtaErrorCategory of an SVTA error code, per the spec's code / 1000 rule.
Parameters
code
number
An SVTA error code.
Returns
SvtaErrorCategory | undefined
The error category. Returns undefined if the code is not a non-negative integer, or if the spec does not assign its category. Categories 8-98 and above 99 are reserved for future use.
Example
ts
const category = getSvtaErrorCategory(SvtaPlaybackErrorCode.VIDEO_BUFFER_UNDERRUN)
assert(category === SvtaErrorCategory.PLAYBACK)