title: how to catch ALL javascript errors with window.onerror? (including dojo)
body: <p>this question is a follow-up to <a href="https://stackoverflow.com/questions/2604976/javascript-how-to-display-script-errors-in-a-popup-alert">javascript: how to display script errors in a popup alert?</a> where it was explained how to catch regular javascript errors using:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      window.onerror = function(msg, url, linenumber) {
          alert('Error message: '+msg+'\nURL: '+url+'\nLine Number: '+linenumber);
          return true;
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I tried it and found out that dojo erros like this one:</p>
  
  <pre><code>TypeError: this.canvas is undefined         dojo.js (Row 446)
  </code></pre>
  
  <p>were not reported using this method, which leads me to my question:</p>
  
  <p>How can I report <strong>all</strong> javascript errors using <code>window.onerror</code> (especially dojo errors)?</p>