Skip to content

Commit

Permalink
feat: capture errors in tx history (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanshparashar authored Oct 2, 2024
1 parent 98a982e commit 5d7349d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import {
isTransferTeleportFromSubgraph,
transformTeleportFromSubgraph
} from '../util/teleports/helpers'
import { captureSentryErrorWithExtraData } from '../util/SentryUtils'

export type UseTransactionHistoryResult = {
transactions: MergedTransaction[]
Expand Down Expand Up @@ -808,6 +809,24 @@ export const useTransactionHistory = (
}
}, [txPages, setPage, page, pauseCount, fetching, runFetcher, isValidating])

useEffect(() => {
if (typeof error !== 'undefined') {
console.warn(error)
captureSentryErrorWithExtraData({
error,
originFunction: 'useTransactionHistoryWithoutStatuses'
})
}

if (typeof txPagesError !== 'undefined') {
console.warn(txPagesError)
captureSentryErrorWithExtraData({
error: txPagesError,
originFunction: 'useTransactionHistory'
})
}
}, [error, txPagesError])

function pause() {
setFetching(false)
}
Expand Down

0 comments on commit 5d7349d

Please sign in to comment.