See
http://api.jquery.com/jQuery.ajax/[
^] for the proper error function. Your error function can accept these parameters:
error: function(jqXHR jqXHR, String textStatus, String errorThrown)
Then analyze jqXHR.responseText. That will give you the error.