You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying Axios' cancellation of network request. It's working great.
I have a question about return Promise.reject(error). When I cancel my http get request, I get Uncaught (in promise) in console in color red. Is this normal?
export function retrieveInformation() {
if (cancel !== undefined) {
cancel();
}
return axios.get('http://blah.blah.com', {
cancelToken: new CancelToken(function executor(c) {
cancel = c;
})
})
.then(res => res)
.catch(error => {
return Promise.reject(error) // <----- When this code is present, I get the error above
});
}```
The text was updated successfully, but these errors were encountered:
I'm trying Axios' cancellation of network request. It's working great.
I have a question about
return Promise.reject(error)
. When I cancel my http get request, I getUncaught (in promise)
in console in color red. Is this normal?The text was updated successfully, but these errors were encountered: