Closed Code-Chops closed 1 year ago
Each effect should handle its own exceptions, because it is in the best position to know what they are and what should be done about each kind.
The StoreInitializer component does have an event for unhandled exceptions, but that's not the route I would advise you go down.
Is there a way to handle exceptions during handling of effects?
My effect handlers communicate with an API and in case something goes wrong it should be gracefully handled.
I know it is possible to place a try-catch in every effect handler and dispatch a fail action when an error occurs, but this has to be implemented all the time and is therefore not preferred.