Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)
})
Source by makandracards.com #
 
PREVIOUS NEXT
Tagged: #js #catch #errors #listeners
ADD COMMENT
Topic
Name
1+8 =