-
Notifications
You must be signed in to change notification settings - Fork 194
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
Handling RequestErrors status codes #178
Comments
Hi @amangeot, three thoughts:
Please let me know if any of these were helpful! |
Thank you @nason for the v3, it looks easier to catch network errors from failure type descriptors Do you have a suggestion on how to refactor network error handling, for example by checking if the fetch response is undefined, without having to edit the 112 RSAA definitions we have? Can we inject fetch option via a middleware for instance? |
I went for a middleware to work on RSAA failure type descriptor's meta, which I intercept later with another middleware to handle errors. Here is the code that works with v3 fetch errors, with failure types being dispatched in network failures:
|
Hello,
I have been using this middleware for a while without any problem so far. I'm curious how one can handle request errors such as a 502 Bad Gateway globally, in order to differentiate connection issues, from bad gateways.
For example, below is a 502 Bad Gateway, logging actions via a middleware coming after redux-api-middleware.
How can one access the response status code (502) inside a middleware?
Thank you,
The text was updated successfully, but these errors were encountered: