Commit 47b6a7c4 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

build: add chainId as tag in sentry ErrorBoundary (#6345)

* build: add chainId to sentry tags

* set it in web3provider

* set before sending
parent 086fc654
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import * as Sentry from '@sentry/react' import * as Sentry from '@sentry/react'
import { useWeb3React } from '@web3-react/core'
import { ButtonLight, SmallButtonPrimary } from 'components/Button' import { ButtonLight, SmallButtonPrimary } from 'components/Button'
import { ChevronUpIcon } from 'nft/components/icons' import { ChevronUpIcon } from 'nft/components/icons'
import { useIsMobile } from 'nft/hooks' import { useIsMobile } from 'nft/hooks'
...@@ -217,11 +218,13 @@ const updateServiceWorkerInBackground = async () => { ...@@ -217,11 +218,13 @@ const updateServiceWorkerInBackground = async () => {
} }
export default function ErrorBoundary({ children }: PropsWithChildren): JSX.Element { export default function ErrorBoundary({ children }: PropsWithChildren): JSX.Element {
const { chainId } = useWeb3React()
return ( return (
<Sentry.ErrorBoundary <Sentry.ErrorBoundary
fallback={({ error, eventId }) => <Fallback error={error} eventId={eventId} />} fallback={({ error, eventId }) => <Fallback error={error} eventId={eventId} />}
beforeCapture={(scope) => { beforeCapture={(scope) => {
scope.setLevel('fatal') scope.setLevel('fatal')
scope.setTag('chain_id', chainId)
}} }}
onError={() => { onError={() => {
updateServiceWorkerInBackground() updateServiceWorkerInBackground()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment