Chrome Error Console Console :: ERR_INTERNET_DISCONNECTED

I have a rich javascript-based internet application that interacts with a web server using ajax \ https (s) requests, where I use several external javascript libraries (e.g. qooxdoo). Since these external libraries can write error messages, and I want to be noticed without an open error console in the developer tools, I need to automatically collect error messages on the client-side error console (Chrome 47.0) using javascript code to send them back to the web server for control purposes.

For this purpose I use code like this:

var origFunc = console.error
console.error = function(){
  // special stuff
  if(origFunc) {
    origFunc.apply(console, arguments);
  }
}

I see this hook in the code for many errors, but I do not notice when the net :: ERR_INTERNET_DISCONNECTED error occurs. I see an error in the Chrome error console, but the console.error method is not called.

Inside the chrome creation tools, you can easily reproduce this error by setting the network offline: chrome network throttling to offline

I even tried the following things:

  • hook in onerror method in window object
  • add an event listener for the ononline and onoffline events to the window object
  • control of the online property of the navigator object

None of these solutions will catch the net :: ERR_INTERNET_DISCONNECTED error message.

net:: ERR_INTERNET_DISCONNECTED? - (, , ..), , ?

+4

Source: https://habr.com/ru/post/1623108/


All Articles