Skip to content

Commit

Permalink
fix: push log into Sentry when US user is detected (cowprotocol#3924)
Browse files Browse the repository at this point in the history
* chore: don't check US users on Gnosis chain

* fix: push log into Sentry when US user is detected

* chore: fix GeoBlockingError
  • Loading branch information
shoom3301 authored Feb 28, 2024
1 parent 99e004a commit bce2f42
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libs/tokens/src/updaters/TokensListsUpdater/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { upsertListsAtom } from '../../state/tokenLists/tokenListsActionsAtom'
import { atomWithStorage } from 'jotai/utils'
import { atomWithPartialUpdate, isInjectedWidget } from '@cowprotocol/common-utils'
import { getJotaiMergerStorage } from '@cowprotocol/core'
import * as Sentry from '@sentry/browser'

const { atom: lastUpdateTimeAtom, updateAtom: updateLastUpdateTimeAtom } = atomWithPartialUpdate(
atomWithStorage<Record<SupportedChainId, number>>(
Expand Down Expand Up @@ -88,6 +89,17 @@ export function TokensListsUpdater({ chainId: currentChainId }: TokensListsUpdat
updateLastUpdateTime({ [chainId]: 0 })
}
})
.catch((error) => {
const sentryError = Object.assign(error, {
name: 'GeoBlockingError',
})

Sentry.captureException(sentryError, {
tags: {
errorType: 'GeoBlockingError',
},
})
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [chainId])

Expand Down

0 comments on commit bce2f42

Please sign in to comment.