THEOplayer has different types of error events.
One of those error events is the "generic player error event".
This error event indicates a fatal error, and can be intercepted through the Player
interface.
This error event exposes an "error code" to explain the occurred error. An error code may be more interesting to track than a verbose error messages For example, if you are logging errors through an analytics service, it could be useful to filter them by their error code.
An error code is a number (e.g. 2001), and it belongs to a category. The format of an error code is "[category][sub-code]". For example, error "2001" belong to category 2, and has sub-code 001.
Refer to "How to do error handling" to learn how to detect the "generic player error event".
The "generic player error event" is available across platforms and SDKs.
Web SDK | Android SDK | iOS SDK | tvOS SDK | Android TV SDK | Chromecast SDK |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
Each error code belongs to an error category. At the time of writing, there are 11 categories.
You can programmatically request the list of available error categories through the THEOplayer API.
For example, on the Web SDK, you can access this list through THEOplayer.ErrorCategory
,
as illustrated by the screenshot below.
You can also programmatically request the category of an error code through the THEOplayer API.
For example, on the Web SDK, you can access this through THEOplayer.ErrorCategory.fromCode(<errorCode>)
.
(Meaning: THEOplayer.ErrorCategory.fromCode(11000)
would return 11
.)
Relevant API references:
Web SDK
Android SDK
iOS SDK
ErrorCategory
An error code is prefixed with its category. For example, code 11001
belongs to category 11
, and has sub-code 001.
If the error is a generic sub-code for its category, then the sub-code will be 000
.
In other words, error 11000
would be the "catch-all" for category 11
.
You can programmatically request the list of all available error codes through the THEOplayer API.
For example, on the Web SDK, you can access this through THEOplayer.ErrorCode
,
as illustrated by the screenshot below.
Relevant API references: