From 5a99ee0e7412c44fe97447747087d71b4cf8a3d8 Mon Sep 17 00:00:00 2001 From: Sjoerd <svink@graphpolaris.com> Date: Tue, 5 Nov 2024 08:44:14 +0000 Subject: [PATCH] feat: error boundary around main app component --- apps/web/src/main.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsx index 7244e35a9..e25807e6d 100644 --- a/apps/web/src/main.tsx +++ b/apps/web/src/main.tsx @@ -6,6 +6,7 @@ import { store } from '@graphpolaris/shared/lib/data-access/store'; import App from './app/App'; import { createRoot } from 'react-dom/client'; import './main.css'; +import { ErrorBoundary } from '@graphpolaris/shared/lib/components/errorBoundary'; if (import.meta.env.SENTRY_ENABLED) { Sentry.init({ @@ -25,10 +26,12 @@ if (domNode) { root.render( <Provider store={store}> <Router> - <Routes> - <Route path="/" element={<App load={undefined} />}></Route> - <Route path="/fraud" element={<App load="5bdf3354-673f-4dec-b6a0-196e67cd211c" />}></Route> - </Routes> + <ErrorBoundary fallback={<div>Oops! Something went wrong. Please try again.</div>}> + <Routes> + <Route path="/" element={<App load={undefined} />}></Route> + <Route path="/fraud" element={<App load="5bdf3354-673f-4dec-b6a0-196e67cd211c" />}></Route> + </Routes> + </ErrorBoundary> </Router> </Provider>, ); -- GitLab