title: How do I associate an Ajax error result with the original request?
body: <p>I am sending data to the server in small bursts using the jQuery <code>ajax</code> function.  Each chunk of data is a simple key-value map (the <code>data</code> property passed to the <code>ajax</code> function).</p>
  
  <p>If a request fails, how can my error event handler identify <em>which</em> specific set of data failed to be uploaded?</p>
  
  <p>The function signature of the jQuery error handler is:</p>
  
  <pre><code>error(XMLHttpRequest, textStatus, errorThrown)
  </code></pre>
  
  <p>Neither <code>textStatus</code> or <code>errorThrown</code> seem useful to identify the failed set of data, and the XHR doesn't seem to offer that capability either.</p>
  
  <p>Simply put, if a request fails, I want to be able to get the <code>id</code> property of the <code>data</code> that I passed to the <code>ajax</code> function.  How can I do this?</p>