check the error code 500 in ajax code example
Example: jquery ajax 500 error handling
$.ajax({
statusCode: {
500: function() {
alert("Script exhausted");
}
}
});
$.ajax({
statusCode: {
500: function() {
alert("Script exhausted");
}
}
});