Undocumented jQuery.ajax() differences between .fail() and error callback.
On http://api.jquery.com/jquery.ajax/#jqXHR jqXHR.fail() it's described with these word:
jqXHR.fail(function( jqXHR, textStatus, errorThrown ) {});
An alternative construct to the error callback option, the .fail() method replaces the deprecated .error() method. Refer to deferred.fail() for implementation details.
An alternative construct suggests that using any of these methods will result in the same behavior. In fact they differ quite significantly, because error is not called when beforeSend returns false, while .fail() is called in that case, additionally with completely undocumented canceled status. It looks like all that stuff came with http://bugs.jquery.com/ticket/10944 and the changes it brought have not been documented at all.
If you reach this place, you might find this SO posts helpful: Should I use .done() and .fail() for new jQuery AJAX code instead of success and error and jQuery ajax() using success, error and complete vs .done(), .fail() and always().