-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Solved] ERROR action not triggered #311
Comments
This comment has been minimized.
This comment has been minimized.
The problem was what a long time ago I wrote an interceptor. export function* onErrorSaga(error: AxiosResponse, action: AnyAction): Iterator<AxiosResponse | Effect<any>> {
...
...
return error;
} and was returning the error object. But axios has a To fix the issue I changes the return value as in interceptors docs. export function* onErrorSaga(error: AxiosResponse, action: AnyAction): Iterator<AxiosResponse | Effect<any>> {
...
...
return { error };
} |
@strdr4605 Thx for sharing this and I am glad you solved it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@klis87, I have a bug when implementing the workaround with promises. My driver is as in #244 (comment). And the request is triggered and the
SUCCESS
is coming ok. But then there is an error from backendSUCCESS
is triggered instead ofERROR
.I tried several options.
All of the actions above resolve in
SUCCESS
instead ofERROR
. Also, I tried networkReducer but still the same behavior.Interesting is that when I pass a rejected Promise
The
ERROR
action is triggered.I made a dummy project https://codesandbox.io/s/redux-saga-requests-example-x4bf6 but there everything works as expected.
Maybe you have an Idea where can be the problem.
The text was updated successfully, but these errors were encountered: