How to catch global Error in JS ?
Like title says.
as same as window.onerror in Browser
Thanks.
What's your use case? I thought window.onerror is considered bad practice nowadays.
It could be added to the EJJavaScriptView's logException method, calling a function on the windowEventsDelegate. But we can't use Ejecta's usual triggerEvent function for this, because window.onerror expects some more parameters instead of just an event object. See https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror
I'm not a fan :/
Sometimes, an uncaught exception will make the game be frozen , I hope the game could be reload or do something else .