Skip to content
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

How to have error handling mechanism in microfrontends? #59

Open
OneShiv opened this issue Sep 30, 2021 · 1 comment
Open

How to have error handling mechanism in microfrontends? #59

OneShiv opened this issue Sep 30, 2021 · 1 comment

Comments

@OneShiv
Copy link

OneShiv commented Sep 30, 2021

I have read few blogs and it makes sense to have error handling responsibility given to each micro-frontend.
But there might be scenarios where among micro-frontend you would like to have consistency in handling common errors specially for api status 400/500 ones. If we extract api abstraction layer into a package or in orchestrator application where should we put our error handling mechanism?

@ukslim
Copy link

ukslim commented Oct 1, 2021

One option is to have a micro-frontend dedicated to responding to such errors - I guess what you mean by "handling" is some sort of visible element saying "Something went wrong, please try again later" etc.

This MFE would listen for events published by other MFEs in the browser window. Now the only thing the MFEs experiencing the errors need to do, is publish the "This error happened to me" event. Look around for various mechanisms MFEs can communicate on an event bus. The Manning book suggests CustomEvent API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants