BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.83k stars 3.4k forks source link

How to catch error throw by FileTools.ReadFile? #14083

Closed UreMySunshine closed 1 year ago

UreMySunshine commented 1 year ago

like https://github.com/BabylonJS/Babylon.js/pull/10209 will it possible to catch error in FileTools.ReadFile? when parse an unlegal file, it will throw bad hdr format error, but i cannot catch the errors by onError or wrap it with try catch.

sebavan commented 1 year ago

As indicated in the template, please first report the problem to forum for discussion.

do not hesitate to create a PR logging the error as done in #10209 ? I can do it if you prefer.