Commit 8392c29a authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

feat: omit unnecessary sentry logs (#6166)

* fix: omit gracefully handled events from sentry

* fix: log locale load exception to sentry
parent 8d36edf2
import { Trans } from '@lingui/macro'
import * as Sentry from '@sentry/react'
import { Currency, Price, Token } from '@uniswap/sdk-core'
import { FeeAmount } from '@uniswap/v3-sdk'
import { AutoColumn, ColumnCenter } from 'components/Column'
......@@ -156,10 +155,6 @@ export default function LiquidityChartRangeInput({
[isSorted, price, ticksAtLimit]
)
if (error) {
Sentry.captureMessage(error.toString(), 'log')
}
const isUninitialized = !currencyA || !currencyB || (formattedData === undefined && !isLoading)
return (
......
import * as Sentry from '@sentry/react'
import { Token } from '@uniswap/sdk-core'
import { SupportedChainId } from 'constants/chains'
import uriToHttp from 'lib/utils/uriToHttp'
......@@ -39,11 +38,10 @@ async function getColorFromToken(token: Token): Promise<string | null> {
logoURI = URIForEthToken(address)
return await getColorFromUriPath(logoURI)
} catch (error) {
Sentry.captureMessage(error.toString())
console.warn(`Unable to load logoURI (${token.symbol}): ${logoURI}`)
return null
}
}
return null
}
async function getColorFromUriPath(uri: string): Promise<string | null> {
......
import * as Sentry from '@sentry/react'
import { Currency, Token } from '@uniswap/sdk-core'
import { FeeAmount } from '@uniswap/v3-sdk'
import useBlockNumber from 'lib/hooks/useBlockNumber'
......@@ -89,8 +88,7 @@ function usePoolTVL(token0: Token | undefined, token1: Token | undefined) {
}
if (latestBlock - (_meta?.block?.number ?? 0) > MAX_DATA_BLOCK_AGE) {
Sentry.captureMessage(`Graph stale (latest block: ${latestBlock})`, 'log')
console.log(`Graph stale (latest block: ${latestBlock})`)
return {
isLoading,
error,
......
......@@ -84,7 +84,8 @@ export async function dynamicActivate(locale: SupportedLocale) {
// Bundlers will either export it as default or as a named export named default.
i18n.load(locale, catalog.messages || catalog.default.messages)
} catch (error) {
Sentry.captureMessage(error.toString())
console.error(error)
Sentry.captureException(new Error(`Unable to load locale (${locale})`))
}
i18n.activate(locale)
}
......
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