Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
110 stars 72 forks source link

Use error boundry to show an error message when studio crashes #7265

Closed ivarne closed 2 weeks ago

ivarne commented 2 years ago

When some problem causes an exception while rendering designer, the entire react tree is unmounted and the user will see a white page.

Describe the solution you'd like

We should use react error boundaries to show a proper error message. These should be placed at different levels at in the component hierarchy to enable context sensitive help when app developers might have encountered a common issue.

Additional context

Some errors are caused by malformed json files in the git repo. Those should have clear error messages, because app developers will encounter them and be expected to fix them.

A simple "better than nothing" implementation for the lowest level that does not give any help can be found at https://github.com/Altinn/altinn-studio/compare/master...ivarne:errorBoundry

FinnurO commented 1 year ago

Example of bug in #5306 and #7361

nkylstad commented 2 weeks ago

Closing this as a basic error boundary is in place. More levels of error boundaries will be covered by https://github.com/Altinn/altinn-studio/issues/11754