Open praseodym opened 1 month ago
Discussed with @lkleuver
We introduce an AppStateProvider
that holds global state, like the error state but also the currently selected locale.
Recoverable errors are rendered as a modal and do not trigger navigation, unrecoverable errors show a full page message and have their own path.
The "MVP" implementation for unrecoverable errors show a stack trace and full error message. An improvement for this in production is to encode the error information and show a QR code to the user, that allows them to communicate the exact error.
Not that currently we did not introduce any global state apart from fatal errors that are caught and rendered by the ErrorBoundary (using react-router).
Proposed strategy:
ErrorBoundary
to catch and handle unexpected errorsWe keep this error state global because they represent a state in out global state machine - which in our case is mainly dictated by the router. We want to prevent multiple error states at once.