From bce2f425320b4fca7b901e35860f4cb440bf581d Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Wed, 28 Feb 2024 11:39:31 +0600 Subject: [PATCH] fix: push log into Sentry when US user is detected (#3924) * chore: don't check US users on Gnosis chain * fix: push log into Sentry when US user is detected * chore: fix GeoBlockingError --- libs/tokens/src/updaters/TokensListsUpdater/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/tokens/src/updaters/TokensListsUpdater/index.ts b/libs/tokens/src/updaters/TokensListsUpdater/index.ts index 9d537d7ed4..1abdf615fe 100644 --- a/libs/tokens/src/updaters/TokensListsUpdater/index.ts +++ b/libs/tokens/src/updaters/TokensListsUpdater/index.ts @@ -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>( @@ -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])