Sandbox/GLTFFileLoader: loading of invalid gltf file never ends

OS: Windows 10
GPU: GTX 1050 2GB
Browser: Firefox 122
Ver: 7.10.2
Expected: A message popup telling user that the gltf is invalid
Actual: Loading never ends

The invalid gltf used for reproduction: (170 Bytes)
Assuming a simple try-catch would workaround this, but not sure if there is better solutions, like some global or shared error handlers

Let me check that :slight_smile:

Add a try catch to protect from invalid data by deltakosh · Pull Request #15187 · BabylonJS/Babylon.js (

Validated the catch working on Babylon.js Sandbox - View glTF, glb, obj and babylon files , but the raw error got ignored, should it be kept as args of onError callback, or logged?

My assumption was that the error will be logged by the throw but now I’m second guessing myself

Wanna do a PR to add it to the error callback?

Well, I mean this catch here:

The error being catched here is never logger, nor passed to onError, so users or devs can only know about the model being loaded is not right, but not exactly where went wrong, which in my example invalid model, is the JSON.parse error.