Commit bb79c734 authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

feat: add sentry monitoring for NO_ROUTE error (#7204)

feat: add sentry monitoring for no_route error
parent b1da7d87
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 { isUniswapXSupportedChain } from 'constants/chains'
......@@ -163,6 +164,11 @@ 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"))
})
return {
data: { state: QuoteState.NOT_FOUND, latencyMs: getQuoteLatencyMeasure(quoteStartMark).duration },
}
......
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