In the axios document, they used this piece of code
try {
const { data } = await axios.get('/user?ID=12345');
user = data.userDetails;
} catch (error) {
if (axios.isAxiosError(error)) {
handleAxiosError(error);
} else {
handleUnexpectedError(error);
}
}
And if I use axios, in the error I can also see isAxiosError: true. But all the error has this same property.
Of course, if I do this. Then there will be no isAxiosError field at all.
axiosInstance.interceptors.response.use(
(response) => response,
(err) => {
// Any status codes that falls outside the range of 2xx cause this function to trigger
// Do something with response error
return Promise.reject(new Error("error");
}
);
My question is: is there any situation that has isAxiosError: false