title: Can I force jQuery Deferred/Ajax to execute fail handler after it has been resolved?
body: <p>An example to make clear what i want to do. This is what I would usually do:</p>
  
  <pre><code>function success(data, status, jqxhr){
    if ( data.error )
      return failure(jqxhr, status, data.error);
    // process data
  }
  function failure(jqxhr, status, err){
    ...
  }
  
  $.ajax( ... )
    .done(success)
    .fail(failure)
  </code></pre>
  
  <p>Is there any way, i can accomplish this with anonymous functions only, like so?</p>
  
  <pre><code>   $.ajax( ... )
        .done(function(data, status, jqxhr){
           if(data.error)
              // what do i need to do here to jump in to the fail handler?
        })
        .fail(function(jqxhr, status, err){
           ...
        })
  </code></pre>