Answers for "js catch errors on listeners"

0

js catch errors on listeners

// If you would like to access errors thrown from event handlers, 
// you may listen to the error event on window.
// It will be emitted for all uncaught errors in the current JavaScript VM:
window.addEventListener('error', function(event) {
  console.log("Got an uncaught error: ", event.error)
})
Posted by: Guest on March-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language