@@ -31,7 +31,9 @@ import {
3131} from "./lib/formDraftStorage" ;
3232import ErrorBoundary from "./components/ErrorBoundary" ;
3333import ErrorFallback from "./components/ErrorFallback" ;
34+ import RouteErrorBoundary from "./components/RouteErrorBoundary" ;
3435import RouteLoadingFallback from "./components/RouteLoadingFallback" ;
36+ import { captureException } from "./config/sentry" ;
3537import {
3638 LazyAnalytics ,
3739 LazyHome ,
@@ -178,40 +180,90 @@ function AppContent() {
178180 < Route
179181 path = "/"
180182 element = {
181- < LazyHome
182- walletAddress = { walletAddress }
183- usdcBalance = { usdcBalance }
184- xlmBalance = { xlmBalance }
185- />
183+ < RouteErrorBoundary routeName = "home" >
184+ < LazyHome
185+ walletAddress = { walletAddress }
186+ usdcBalance = { usdcBalance }
187+ xlmBalance = { xlmBalance }
188+ />
189+ </ RouteErrorBoundary >
186190 }
187191 />
188192 < Route
189193 path = "/portfolio"
190194 element = {
191- < LazyPortfolio
192- walletAddress = { walletAddress }
193- />
195+ < RouteErrorBoundary routeName = "portfolio" >
196+ < LazyPortfolio
197+ walletAddress = { walletAddress }
198+ />
199+ </ RouteErrorBoundary >
194200 }
195201 />
196202 < Route
197203 path = "/analytics"
198204 element = {
199205 < FeatureGate flag = "ANALYTICS_PAGE" >
200- < LazyAnalytics />
206+ < RouteErrorBoundary routeName = "analytics" >
207+ < LazyAnalytics />
208+ </ RouteErrorBoundary >
201209 </ FeatureGate >
202210 }
203211 />
204- < Route path = "/transactions" element = { < LazyTransactionHistory walletAddress = { walletAddress } /> } />
205- < Route path = "/compare" element = { < LazyVaultComparison /> } />
206- < Route path = "/strategies/:strategyId" element = { < StrategyDetail walletAddress = { walletAddress } /> } />
207- < Route path = "/receipt/:txHash" element = { < TransactionReceipt /> } />
208- < Route path = "/settings" element = { < LazySettings /> } />
209- < Route path = "/ui-kit" element = { < LazyUIPreview /> } />
212+ < Route
213+ path = "/transactions"
214+ element = {
215+ < RouteErrorBoundary routeName = "transactions" >
216+ < LazyTransactionHistory walletAddress = { walletAddress } />
217+ </ RouteErrorBoundary >
218+ }
219+ />
220+ < Route
221+ path = "/compare"
222+ element = {
223+ < RouteErrorBoundary routeName = "vault-comparison" >
224+ < LazyVaultComparison />
225+ </ RouteErrorBoundary >
226+ }
227+ />
228+ < Route
229+ path = "/strategies/:strategyId"
230+ element = {
231+ < RouteErrorBoundary routeName = "strategy-detail" >
232+ < StrategyDetail walletAddress = { walletAddress } />
233+ </ RouteErrorBoundary >
234+ }
235+ />
236+ < Route
237+ path = "/receipt/:txHash"
238+ element = {
239+ < RouteErrorBoundary routeName = "transaction-receipt" >
240+ < TransactionReceipt />
241+ </ RouteErrorBoundary >
242+ }
243+ />
244+ < Route
245+ path = "/settings"
246+ element = {
247+ < RouteErrorBoundary routeName = "settings" >
248+ < LazySettings />
249+ </ RouteErrorBoundary >
250+ }
251+ />
252+ < Route
253+ path = "/ui-kit"
254+ element = {
255+ < RouteErrorBoundary routeName = "ui-preview" >
256+ < LazyUIPreview />
257+ </ RouteErrorBoundary >
258+ }
259+ />
210260 < Route
211261 path = "/admin"
212262 element = {
213263 < ProtectedRoute role = { role } allow = { [ "admin" ] } >
214- < Admin walletAddress = { walletAddress } />
264+ < RouteErrorBoundary routeName = "admin" >
265+ < Admin walletAddress = { walletAddress } />
266+ </ RouteErrorBoundary >
215267 </ ProtectedRoute >
216268 }
217269 />
@@ -256,7 +308,7 @@ function App() {
256308 ) }
257309 showDialog = { false }
258310 >
259- < ErrorBoundary >
311+ < ErrorBoundary onError = { ( error ) => captureException ( error , { route : "app-root" } ) } >
260312 < AuthProvider >
261313 < FeatureFlagProvider >
262314 < VaultProvider >
0 commit comments