From 5ac9013ceea8d104f540cb69b5b441a5d1cffe93 Mon Sep 17 00:00:00 2001 From: Bartek Date: Mon, 16 Dec 2024 14:08:05 +0100 Subject: [PATCH] add sentry error --- .../src/hooks/useTransactionHistory.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts b/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts index 27cfe6e581..11e335aea9 100644 --- a/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts +++ b/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts @@ -929,7 +929,7 @@ const useMappedReceiverTransactionHistory = ({ }): UseMappedTransactionHistoryResult => { const { isLoading: isLoadingAccountType } = useAccountType() - const { rawData, rawDataLoading, rawDataErroredChains } = + const { rawData, rawDataLoading, rawDataErroredChains, rawDataError } = useRawTransactionHistory({ address, fetchFor: 'receiver', @@ -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,