title: jQuery: catch ajax exceptions
body: <p>Many failed jQuery ajax requests are polluting my console with errors. Looking at the code which produces these console errors (jQuery 1.7.2, line 8240)</p>
  
  <pre><code>                // Do send the request
                  // This may raise an exception which is actually
                  // handled in jQuery.ajax (so no try/catch here)
                  xhr.send( ( s.hasContent &amp;&amp; s.data ) || null );
  </code></pre>
  
  <p>I notice the comment explains why there is no <code>try</code>/<code>catch</code> there. However, even though I have an explicit <code>error</code> callback function in my <code>jQuery.ajax</code> request, I'm <em>still</em> not having those errors handled by <code>jQuery.ajax</code>.</p>
  
  <p>How can I handle jQuery ajax errors in such a way that error messages do <em>not</em> appear in the console?</p>
  
  <p><em>Edit:</em> Below is my code snippet that does the ajax request, and the precise error message (in Chrome):</p>
  
  <pre><code>$.ajax({
      dataType: 'xml',
      url: "./python/perfdata.xml?sid=" + (new Date()),
      success: function (data) {
          var protocols = $("Protocols", data).children();
  
          parseData(protocols);
      },
      error: function (error) {
          setTimeout(getData, 200);
      }
  });
  </code></pre>
  
  <p>And here is the Chrome error message:</p>
  
  <pre><code>GET
  http://zeus/dashboard/python/perfdata.xml?sid=Thu%20May%2024%202012%2016:09:38%20GMT+0100%20(GMT%20Daylight%20Time)
  jquery.js:8240
  </code></pre>