title: Catching "Server not found" exception
body: <p>In a standalone XUL app, I'd like to catch the <code>server not found</code> exception. I've tried by  checking state in <code>onStateChange</code> event of the <code>nsIWebProgressListener</code>, but this doesn't seem to work. My <code>onStateChange</code> event implementation is as shown below. I'm making the assumption that if <code>STATE_START</code> or <code>STATE_STOP</code> is not returning a valid value, then there's something wrong with page loading, and displays the error message to the user.</p>
  
  <pre><code>onStateChange: function(aProgress, aRequest, aFlag, aStatus) {
    const STATE_START = Components.interfaces.nsIWebProgressListener.STATE_START;
    const STATE_STOP = Components.interfaces.nsIWebProgressListener.STATE_STOP; 
  
    if(aFlag &amp; STATE_START) {
        document.getElementById("progressBar").hidden = false;
    }
    if(aFlag &amp; STATE_STOP) {
        setTimeout(function() { document.getElementById("progressBar").hidden = true; }, 2000);     
    }
  
    if(aFlag &amp; (!STATE_START | !STATE_STOP)) {
      alert("Your connection seems to be down. Please confirm with your system admin.");    
    }
    return 0;
  </code></pre>
  
  <p>}, </p>
  
  <p>Can someone kindly advice me on what I'm doing wrong? Thanks in advance.</p>