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 thinking about error handling in redux. Imagine a situation of handling form submit which can return different errors: 400, 401, 500.
When 400 is returned, I want to show a message in top of the form (override the default behavior).
For other (unhandled) error codes, the default (global) error handler should be invoked (which shows notification toast). Just don't want to duplicate this code for every single action
I dispatch async actions using redux-thunk middleware
I can create a reducer which handles all {error: true} actions and show some popup-notification (probably without using redux state, directly invoking some toast.show() method)
But how to determine if this special error was already handled somewhere in the state tree?
The text was updated successfully, but these errors were encountered:
Please use StackOverflow for usage questions. This is the only way to ensure the same question doesn’t get asked many times in a row, and that folks who have the same question in the future will be able to find it. (Github search is pretty much useless.)
Sorry we couldn’t answer your question here. Please feel free to post a link to the StackOverflow question, and I’ll be happy to try to answer it.
I'm thinking about error handling in redux. Imagine a situation of handling form submit which can return different errors: 400, 401, 500.
When 400 is returned, I want to show a message in top of the form (override the default behavior).
For other (unhandled) error codes, the default (global) error handler should be invoked (which shows notification toast). Just don't want to duplicate this code for every single action
I dispatch async actions using redux-thunk middleware
I can create a reducer which handles all {error: true} actions and show some popup-notification (probably without using redux state, directly invoking some toast.show() method)
But how to determine if this special error was already handled somewhere in the state tree?
The text was updated successfully, but these errors were encountered: