Luciano Júnior
Luciano Júnior

Reputation: 367

Handling HTTP errors with ngRx

I am developing a Angular app using ngRx and trying to exercise its best practices. But I came to place where I couldn't find how to proceed correctly, and that's dealing with HTTP (or Firebase) errors, and presenting them to the users.

I created actions for error handling in my app and I can, for example, show a modal when the user types a wrong password, but I don't if that is nice. I would be having to reuse error handling in all forms components...

Could I construct a "global" effect that gets all my actions with _FAILED (e.g) and opens a error Modal? Who should show the Modal, the effects or the component holding the form?

Would be very helpful if anyone could share its experience!

Upvotes: 4

Views: 2495

Answers (1)

RV.
RV.

Reputation: 2998

Here is a very good example of Error handling in ngrx. It covers error from HTTP in effects to point of showing it in page to user. I hope this is what you are looking for.

Upvotes: 1

Related Questions