title: Get more information from a failed JQuery jqXHR request
body: <p>I'm using JQuery's <code>$.when</code> and <code>$.get</code> to fetch some data and do something with it. When there is an error fetching it or doing something with it, I want to handle that error, and handle it <em>differently</em> depending on which data I was fetching/at which path I was fetching it.</p>
  
  <p>Unfortunately, the information passed to <code>$.when().fail(...)</code> is scant, and doesn't include that information. How might I bubble up that information from the deferrable in a non-hacky[1] way?</p>
  
  <pre><code>$.when(get(path1), get(path2)
    .done(function(parsed1, parsed2) {
      // do something with this date
    }).fail(function(jqXHR, statusTxt, errTxt) {
      // do something depending on which path failed...
    });
  
  function get(path) {
    var parser = U.parser();
    return $.get('/getter' + path)
      .then(function(data) {
        return parser(data);
      });
  }
  </code></pre>
  
  <p>[1]: Sure, I could close around the path and some global objects I want to handle failure with, and handle it in a <code>.fail()</code> on the Deferred that <code>$.get</code> returns. I could also pass up a Deferred that doesn't failed, but wraps the failure in some way, but that also feel very hacky. </p>