Skip to content

Commit

Permalink
add sentry error
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Dec 16, 2024
1 parent 14fca0d commit 5ac9013
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ const useMappedReceiverTransactionHistory = ({
}): UseMappedTransactionHistoryResult => {
const { isLoading: isLoadingAccountType } = useAccountType()

const { rawData, rawDataLoading, rawDataErroredChains } =
const { rawData, rawDataLoading, rawDataErroredChains, rawDataError } =
useRawTransactionHistory({
address,
fetchFor: 'receiver',
Expand Down Expand Up @@ -1014,6 +1014,24 @@ const useMappedReceiverTransactionHistory = ({
[updateTransactionInSwrCache]
)

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

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

return {
transactions: receiverTransactions || [],
error: receiverTransactionsError,
Expand Down

0 comments on commit 5ac9013

Please sign in to comment.