Handle error on reader.read error
Description
Ran into an edge case where if the network is interrupted during a download, an uncaught network error occurs. Unfortunately FileLoader isn't able to recover from here because the url is still listed in the module level loading object. There is already a catch handler for the fetch call which should handle this case so this is just added in so the error handling is propagated up.
This contribution is funded by VRIFY
Great thanks - can you provide steps on how to reproduce the issue for testing?
Great thanks - can you provide steps on how to reproduce the issue for testing?
For sure, the steps involve using the dev tools to get since it's an edge case error while downloading. For ease of testing I created a code sandbox, please let me know if you'd prefer a different format
https://codesandbox.io/s/tender-sinoussi-cjnzko
For ease of testing it uses one of our models that's a little larger.
Steps:
- Go to chrome dev tools and throttle the download speed (for ease of turning offline)
- Once the .glb file starts downloading, switch the throttle to "Offline"
Expected:
onError callback should be called in loader.load
Actual: Error isn't called back and instead is uncaught in promise
