Skip to main content
Question

Is there an alternative to window.onerror() since the plugin's iFrame doesn't trigger that event?

  • February 22, 2023
  • 3 replies
  • 528 views

Alex_FG

I would like to properly crash my plugin and prevent any more interactions when an unhandled exception happens, but onerror() is not available. I know wrapping everything in try/catch is an option, but in my case that’s a loooot of work. Is there another automatic way to be notified of errors?

This topic has been closed for replies.

3 replies

tank666
  • 4873 replies
  • February 22, 2023

window.onerror is available. Did you declare it in ui.html?


Alex_FG
  • Author
  • New Participant
  • 32 replies
  • February 22, 2023

I’m not sure what you mean by “declare”. I tried adding to window an event listener for ‘error’, but the event never arrives.


tank666
  • 4873 replies
  • February 22, 2023
onerror = (event) => console.error(event);
nonExistentVariable;

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings