1.133 An error occurred while rendering. Rendering has stopped

Is this a mistake I have made calling some function or is this an internal error ?

The stack really doesn’t say what function I called to cause the issue…

It’s usually much easier to provide a helpful answer when there is a ‘Sandcastle’ with which the error can be reproduced. And in the sandcastle, the stack trace will also not be obfuscated, so there, it should be trivial to figure out where exactly the error is caused.

However, the message sounded familiar - that oddly specific value of 0.0125. So I’ll take a wild guess: Are you, by any chance, trying to render something (polylines) near one of the poles?

(The number of threads that can be found when searching for 0.0125 in the forum should be a hint that there’s something that has to be addressed, but for now, I’ll only point to When and how do you handle "Expected value to be greater than or equal to 0.0125" ? )

Hi thanks, yes, indeed that was the problem.

May I suggest that instead of crashing the rendering the return code or exception is returned to the function that is being called ? This will allow developers better to isolate the problem.

There are a few aspects of the error handling that may have to be improved in terms of flexibility and clarity. I have not yet tried out out with that particular example (and even don’t know whether the error is really exactly the same in your case), but in theory, you can catch such an error using the scene.renderError event:

viewer.scene.renderError.addEventListener(function(scene, error) {
   console.error("Whoopsie: ", error);
});

(This still ignores the question of whether that error should be thrown to begin with - I could imagine that there is a better way of handling ~“points near the poles” than crashing…)

Indeed. Software shouldn’t crash but catch the error and return the error up the stack all the way up to the calling function in this case.

I suggest this should be fixed in the Cesium code.

Although this error (with that 0.0125) is well-known, I think that it is not really tracked anywhere. I recently opened Some runtime errors are not handled properly · Issue #12876 · CesiumGS/cesium · GitHub but that mainly referred to the model loading process. The 0.0125-error is mentioned in Incorrect CZML-Corridor behavior · Issue #12501 · CesiumGS/cesium · GitHub , but this is likely not the first or only issue mentioning this, and the issue is far more generic than that (seemingly) specific CZML-based case.