title: Chrome Error Console net::ERR_INTERNET_DISCONNECTED
body: <p>I have a rich internet application based on javascript communicating with a webserver by ajax\https(s) requests, where I use a few external javascript libraries (e.g. qooxdoo). Because this external libraries can write error messages and I want to get noticed of them without an open error console in the developer tools, I need to collect automatically error messages on the client side error console (Chrome 47.0) by javascript code to send them back to the webserver for controlling purposes.</p>
  
  <p>For this purpose I use a kind of code like this:</p>
  
  <pre><code>var origFunc = console.error
  console.error = function(){
    // special stuff
    if(origFunc) {
      origFunc.apply(console, arguments);
    }
  }
  </code></pre>
  
  <p>I get noticed by this hook in code for many errors, but I do not get noticed, when a net::ERR_INTERNET_DISCONNECTED error occurs. I see the error in the chrome error console, but the method "console.error" is not called.</p>
  
  <p>Inside the chrome developer tools it is possible to reproduce this error easily by setting the network offline:<a href="http://i.stack.imgur.com/CcrgI.png" rel="noreferrer">chrome network throttling to offline</a></p>
  
  <p>I even tried the following things:</p>
  
  <ul>
  <li>hook in the method onerror in the window object</li>
  <li>add an event listener for the events "ononline" and "onoffline" to the window object</li>
  <li>controlling the "online" property of the navigator object</li>
  </ul>
  
  <p>None of this solutions works to catch the net::ERR_INTERNET_DISCONNECTED Error message.</p>
  
  <p>How can I get noticed of net::ERR_INTERNET_DISCONNECTED error messages? Does some function or event in one of the BOM objects (console, window, navigator, etc.) exists, where I can add an event listener or hook in a function to catch this error message?</p>