Compare commits

...

1 Commits

Author SHA1 Message Date
Charles Bachmeier
0b4e192f5d refactor: log NO_ROUTE found instead of paging (#7243)
Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
2023-08-29 13:59:26 -07:00

View File

@@ -1,7 +1,7 @@
import { createApi, fetchBaseQuery, FetchBaseQueryError } from '@reduxjs/toolkit/query/react'
import * as Sentry from '@sentry/react'
import { Protocol } from '@uniswap/router-sdk'
import { TradeType } from '@uniswap/sdk-core'
import { sendAnalyticsEvent } from 'analytics'
import { isUniswapXSupportedChain } from 'constants/chains'
import { getClientSideQuote } from 'lib/hooks/routing/clientSideSmartOrderRouter'
import ms from 'ms'
@@ -166,10 +166,10 @@ export const routingApi = createApi({
typeof errorData === 'object' &&
(errorData?.errorCode === 'NO_ROUTE' || errorData?.detail === 'No quotes available')
) {
Sentry.withScope((scope) => {
scope.setExtra('requestBody', requestBody)
scope.setExtra('response', response)
Sentry.captureException(new Error("No routes found for user's quote request, alert Routing Team"))
sendAnalyticsEvent('No quote received from routing API', {
requestBody,
response,
routerPreference: args.routerPreference,
})
return {
data: { state: QuoteState.NOT_FOUND, latencyMs: getQuoteLatencyMeasure(quoteStartMark).duration },