How to access the error in the widget object from the script (Linux)
widget?.on("ready", (w) => {
if (w.$error) {
//Log the error in the console, or handle according to your needs
console.error("Widget error:", w.$error);
// Or throw the error
throw new Error(JSON.stringify(w.$error));
} else {
console.log("No error. Widget loaded successfully");
}
});4. Using Error Details: For simplicity, you can directly access and log the error details:
Conclusion
To successfully capture and log widget error states, it is crucial to handle the error object appropriately. Stringifying the error provides a comprehensive error message. If you encounter further issues or need more assistance, consider exploring the developer documentation linked below.
References/ Related Content
- Sisense Developer Documentation
- SisenseWidget Class | Sisense Developers
- Widget Class | Sisense Developers
Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this please let us know.
0 comments