Try/catch does not intercept error that is thrown from the onError callback

Please take a look at this code example
I provide an invalid url and the onError_mtlLoader callback is triggered as expected.
In the onError_mtlLoader callback, I throw an error and expect the catch block to intercept the throw, but it doesn’t.
In the console I see the following messages:

MTLLoader failed to load
MTLLoader.js:88 Uncaught Error: MTLLoader failed to load
at Object.onError_mtlLoader [as onError] (MTLLoader.js:88)
at XMLHttpRequest. (three.module.js:35715)

How can I intercept the throw from the onError_mtlLoader in the program that called MTLLoader.load ?

I think the problem is that your try/catch block around MTLLoader.load() only would work if a runtime error is thrown in the load method. The onError callback is executed asynchronously and thus is outside of the scope of the try/catch block.

How about using an approach based on loadAsync():

Thanks @Mugen87. You suggestion to use loadAsync solved my problem.