title: How to catch uncaught exception in Promise
body: <p>Is there any way to globally catch all exceptions including Promise exceptions. Example:</p>
  
  <pre><code>    window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
          alert("Error occured: " + errorMsg);//or any message
          return false;
      }
  
      var myClass = function(){
  
      }
  
  
      var pr = new Promise(function(resolve, react){
          var myInstance = new myClass();
          myInstance.undefinedFunction(); // this will throw Exception
          resolve(myInstance);
      });
  
  
      pr.then(function(result){
          console.log(result);
      });
  
      // i know right will be this:
      // pr.then(function(result){
      //     console.log(result);
      // }).catch(function(e){
      //     console.log(e);
      // });
  </code></pre>
  
  <p>This script will silently die without error. Nothing in firebug.</p>
  
  <p>My question is if I do a mistake and forgot to catch it is there any way to catch it globally?</p>