Asset load callback without try/catch

Is it mandatory to have a try/catch on asset loader success callback? Or is there a way to delete that?

Because when we actually have an error, it makes it very annoying to find the origin of the error as the onError function contains very few information like the error message only. But we don’t have the file and line where the error is.
Thus I am putting console everywhere in the success callback to find out what is really the error. How do you guys deal with that?

Thanks :wink:

Well this is your code :wink:

If you have an error in your callback code then wrap it with a try / catch. (Unless I misunderstood the issue)

My problem is that in the onError function the sourceMap isn’t working and I can’t have the exact location of the error.

But indeed using my own try / catch did solve the problem.

I don’t know why I thought it would have been the same. I should have try before asking. Sorry :wink:

1 Like

lol no worries