Propegate an exception to the browser

Hi :slight_smile:
I noticed that when an exception is not handled - for example calling a function in the browser that does not exist - the exception is caught and an alert is shown (this happens automatically, I’m also attaching an image).
Is there a way to disable the alert and re-throw the exception to the browser (without editing the UnityLoader.js file) so I can handle it myself? The thing is, I have a webpage that has an IFrame with a unity WebGL app and I want the unity javascript code to propagate this exception to the webpage code.

Thanks for the help :):slight_smile:

And here’s the file (forgot to attach it)

Hi omriperll, you can try and override the error handler which is what I do to try and narrow done specific errors and present them in a more fashionable way to the user.

You can do this after initialising the game instance in the HTML like so:

UnityLoader.Error.handler = function(e, t)
{
   console.log(e); // Log the exception or do with it what you wish.
   // The actual 'text' is stored in e.message
}

Thanks you very much!!