Closed stefensuhat closed 7 years ago
Per the middleware options docs you need to set returnRejectedPromiseOnError
to true
.
@nmaves hi thanks!! it return at catch.
But I got slight problem with it
here is my interceptor error response function:
function interceptorErrorResponse(dispatch, error) {
const { data } = error.response;
const { code, status } = data.meta;
switch (code) {
case 401:
switch (status) {
case 10:
axios.post('token/refresh').then((response) => {
cookie.save('_t', response.data.token, {
secure: true,
});
});
break;
default:
cookie.remove('_t');
// window.location.assign('/login');
}
break;
default:
return Promise.reject(data);
}
return Promise.reject(data);
}
the problem is every time it return will always return
HTTP Failure in Axios Object {meta: Object}
Object {type: "LOGIN_FAIL", error: Object, meta: Object}
it error object:
data:undefined,
status:0
I am going to close this issue as there as been no interaction for over two months. If this still an issue please reopen the issue.
Hi,
At docs I read at the section
So , I want to tried with my simple form handler to handle error section
reducer:
I want to tried error response to see if its working properly. But it never console it out (422, 401) response.
But If I move my console.log to
then
section it will print it out properly.Why It enter to
success response
instead of catch section (I removed all my response interceptor)?.