Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

global catch in javascript

<script>
  window.onerror = function(message, url, line, col, error) {
    alert(`${message}
 At ${line}:${col} of ${url}`);
  };

  function readData() {
    badFunc(); // Whoops, something went wrong!
  }

  readData();
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #global #catch #javascript
ADD COMMENT
Topic
Name
7+7 =