I am using axios to do my ajax requests and I have something like this
axiosInstance.interceptors.response.use(
function(response) {
return response;
},
function(error) {
if (error.message === 'Network Error') {
toast.dismiss();
toast.error(
'error occured',
{ autoClose: 60000 }
);
} else if (error.response.status === 401) {
uiStores.authenticaionUiStore.logout();
browserHistory.push({ pathname: '/' });
}
return Promise.reject(error);
}
);
now I found out that if someone comes to my site with an ad blocker those ajax calls will be forced blocked and then my error check will be activated.
Is there away I can check for this Err_blocked so that those don't do my toast error?