Is there is any way to disable the call to local error function defined in the Ajax request from global error defined in ajaxError
I have tried numerous ways but unable to disable the call to local error function defined in ajax function, Is that possible?
Note: I do not want to modify local error function or $.ajax because $.ajax is used in number of places.
$( document ).ajaxError(function( event, jqxhr, settings, exception ) {
if(jqxhr.status == 401 || jqxhr.status == 403) {
//customize error response
//disable call to local error
}
});
$.ajax({
error:function(jqXHR, textStatus, errorThrown){
// local error
}
})```