From 639e86bcfd2ceab6a7876769cc7765452d429c13 Mon Sep 17 00:00:00 2001 From: James Gentes Date: Sun, 10 Dec 2023 20:34:50 -0800 Subject: [PATCH] added extra logging --- app/entry.client.tsx | 2 +- app/errorBoundary.tsx | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/entry.client.tsx b/app/entry.client.tsx index ca639da..cfa2eb1 100644 --- a/app/entry.client.tsx +++ b/app/entry.client.tsx @@ -17,7 +17,7 @@ Sentry.init({ useMatches ) }), - new Sentry.Replay() + new Sentry.Replay({ maskAllText: false }) ] }) diff --git a/app/errorBoundary.tsx b/app/errorBoundary.tsx index a6a0809..655434b 100644 --- a/app/errorBoundary.tsx +++ b/app/errorBoundary.tsx @@ -1,9 +1,10 @@ // This is exported in root to automatically catch errors, but can be used anywhere in the app. import { isRouteErrorResponse, useRouteError } from '@remix-run/react' -import { captureRemixErrorBoundaryError } from '@sentry/remix' +import { captureRemixErrorBoundaryError, setContext } from '@sentry/remix' +import { getAudioState, getAppState } from '~/api/db/appState' import App from '~/root' -export const ErrorBoundary = (error: Error) => { +export const ErrorBoundary = async (error: Error) => { const routeError = (useRouteError() as Error) || error const message = isRouteErrorResponse(routeError) @@ -11,6 +12,12 @@ export const ErrorBoundary = (error: Error) => { : routeError?.message || JSON.stringify(routeError) if (message) { + const [audioState] = getAudioState() + setContext('audioState', audioState || {}) + + const [appState] = getAppState() + setContext('appState', appState || {}) + captureRemixErrorBoundaryError(message) return }