Search code examples
cesiumjs

Is there a way to override rendering error dialog with my own


When Cesium generates its "Invalid Array Length" error and crashes instead of showing the normal Cesium "Rendering has stopped" error popup, this error is handled (via an event on the viewer.scene object) and a custom dialog is shown with a more user friendly error. Is there a way of doing this?


Solution

  • The error panel you're seeing comes from a function called showErrorPanel that exists on Cesium.CesiumWidget (which is the component of Cesium.Viewer that actually hosts the Cesium.Scene.

    You can call this function directly on a Viewer or CesiumWidget, or you can override its prototype to install your own error handling mechanism.