LynxError API
LynxError is the standard error object returned by the Lynx runtime to indicate runtime failures, warnings, or recoverable issues in your app.
It contains both machine-readable information (error code, subcode, severity level) and a human-readable message to help with debugging and recovery.
Use Cases
- Display meaningful errors in debug or development mode
- Trigger fallback UI or navigation for fatal runtime issues
- Report errors for analytics or bug tracking
Core Concepts
Error Code
A 3–4 digit number identifying the category or behavior of an error.
For example, 301 represents an image loading error.
Refer to the Error Codes documentation for a full list of codes and their meanings.
Subcode
A 5–6 digit number derived from the error code, used to specify the exact cause of the error.
For example, 30101 indicates that the loaded image is too large.
Refer to the Error Codes documentation for details on individual subcodes.
Level
LynxError defines four levels: Fatal, Error, Warn, and Undecided.
Message
A JSON-formatted string containing detailed error information, including:
codesubcodelevelmessagesuggestion(optional)
Platform Methods
Android
iOS
HarmonyOS
Example
JavaScript
Kotlin
Swift
ETS
Compatibility
LCD tables only load in the browser