47
rated 0 times
[
50]
[
3]
/ answers: 1 / hits: 5342
/ 2 Years ago, fri, february 18, 2022, 12:00:00
Our Vue application had some problems and I noticed in Sentry logs that probably the network has been unreliable:
Error: Network Error
Error: Request aborted
I would like to show warning to the user, but couldn't figure out how to do it. I tried to catch these errors using Axios request interceptor, but they didn't work. Has anyone accomplished this?
EDIT:
This is the interceptor that didn't work. I also have a response interceptor to catch 403 and it works perfectly.
axios.interceptors.request.use(undefined, (err) => {
// Never gets here for network errors
return new Promise((resolve, reject) => {
throw err;
});
});
More From » vue.js