Skip to content

Commit

Permalink
added extra logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jgentes committed Dec 11, 2023
1 parent bee3641 commit 639e86b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Sentry.init({
useMatches
)
}),
new Sentry.Replay()
new Sentry.Replay({ maskAllText: false })
]
})

Expand Down
11 changes: 9 additions & 2 deletions app/errorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
// 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)
? routeError.data.message || routeError.data || routeError
: routeError?.message || JSON.stringify(routeError)

if (message) {
const [audioState] = getAudioState()
setContext('audioState', audioState || {})

const [appState] = getAppState()
setContext('appState', appState || {})

captureRemixErrorBoundaryError(message)
return <App error={message} />
}
Expand Down

0 comments on commit 639e86b

Please sign in to comment.