LynxError

LynxError is the structure used to represent an error, carrying several properties such as code, subcode, level, and error message. Developers can utilize the attributes and methods for troubleshooting.

Android

getErrorCode

public int getErrorCode()

Return the error code. The error code is a 3 to 4-digit number used to denote the behavior of the error. For example, code 301 indicates a loading error for image. You can refer to documentation Error Codes to learn the specific behavior each error code represents.

getSubcode

public int getSubcode()

Return the error subcode. The error subcode is a 5 to 6-digit number derived from extending the error code by 2 digits. The error subcode is used to indicate the cause of the error. For example, subcode 30101 indicates that the loaded image is too large. You can refer to documentation Error Codes to learn the specific cause each error subcode represents.

isFatal

public boolean isFatal()

Determine if the error level is Fatal. LynxError has three levels: Fatal, Error, and Warn. Fatal indicates a critical error that might cause the Lynx page to go blank, requiring the integrator to perform fallback handling; for example, attempting to reload the Lynx page or displaying an error page. Error denotes a non-critical error that might cause some functionalities of the Lynx page to become unavailable. Warn signifies a warning error that does not affect the functionality of the Lynx page but should be addressed if possible. You can refer to documentation Error Codes to learn about the error levels associated with each subcode. If the level is Undecided, it means that the error level for that subcode is determined at runtime.

getMsg

public boolean getMsg()

Return all error information in JSON string format, including the code, subcode, error message, level, and fix suggestion.

iOS

errorCode

- (NSInteger)errorCode

Return the error code. The error code is a 3 to 4-digit number used to denote the behavior of the error. For example, code 301 indicates a loading error for image. You can refer to documentation Error Codes to learn the specific behavior each error code represents.

subcode

- (NSInteger)subcode

Return the error subcode. The error subcode is a 5 to 6-digit number derived from extending the error code by 2 digits. The error subcode is used to indicate the cause of the error. For example, subcode 30101 indicates that the loaded image is too large. You can refer to documentation Error Codes to learn the specific cause each error subcode represents.

isFatal

- (BOOL)isFatal

Determine if the error level is Fatal. LynxError has three levels: Fatal, Error, and Warn. Fatal indicates a critical error that might cause the Lynx page to go blank, requiring the integrator to perform fallback handling; for example, attempting to reload the Lynx page or displaying an error page. Error denotes a non-critical error that might cause some functionalities of the Lynx page to become unavailable. Warn signifies a warning error that does not affect the functionality of the Lynx page but should be addressed if possible. You can refer to documentation Error Codes to learn about the error levels associated with each subcode. If the level is Undecided, it means that the error level for that subcode is determined at runtime.

userInfo

- (NSDictionary*)userInfo

Return an NSDictionary from which the error information can be queried using the key LynxErrorUserInfoKeyMessage. The error information is a JSON string that includes the code, subcode, error message, level, fix suggestion, etc.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.