I am doing a classing ajax ger request:
$.get('/ajax').done(function(data){
//handle data on success
}).fail(function(jqXHR,status,errorThrown){
if(jqXHR.status===500){
//Handle response there
}
})
I want somehow to be able to get the custom response when my endpoint to ajax request returns error 500
.