Try accessing these options for your part of the ajax call error:
error: function (request, status, error) { alert(request.responseText);
Another example:
error: function(xhr) { if(xhr.status == 422) { alert(parseErrors(xhr)); } else { alert('An error occurred while processing the request.'); }
They are part of the ajax call, and you separate them with a comma. So a small example:
$.ajax({ success: function(data) { }, error: function(xhr) { } });
Update: Basically, xhr.status is the http status number.
alert("readyState: "+xhr.readyState); alert("status: "+xhr.status); alert("responseText: "+xhr.responseText);
source share