From 3958ad279c8a4aed1776887dcea9c0124c89681f Mon Sep 17 00:00:00 2001 From: rickycodes Date: Fri, 25 Sep 2020 13:46:24 -0400 Subject: [PATCH] Send caught errors to sentry --- app/components/Nav/Main/index.js | 1 + app/components/Views/Approval/index.js | 2 ++ app/components/Views/ApproveView/Approve/index.js | 2 ++ app/components/Views/Send/index.js | 1 + app/components/Views/SendFlow/Confirm/index.js | 1 + 5 files changed, 7 insertions(+) diff --git a/app/components/Nav/Main/index.js b/app/components/Nav/Main/index.js index a3749e25cef..bbd882c7e17 100644 --- a/app/components/Nav/Main/index.js +++ b/app/components/Nav/Main/index.js @@ -777,6 +777,7 @@ class Main extends PureComponent { Alert.alert(strings('transactions.transaction_error'), error && error.message, [ { text: strings('navigation.ok') } ]); + Logger.error(error, 'error while trying to send transaction (Main)'); this.setState({ transactionHandled: false }); } }; diff --git a/app/components/Views/Approval/index.js b/app/components/Views/Approval/index.js index 830351f2947..cc053138de7 100644 --- a/app/components/Views/Approval/index.js +++ b/app/components/Views/Approval/index.js @@ -15,6 +15,7 @@ import { getTransactionReviewActionKey, getNormalizedTxState } from '../../../ut import { strings } from '../../../../locales/i18n'; import { safeToChecksumAddress } from '../../../util/address'; import { WALLET_CONNECT_ORIGIN } from '../../../util/walletconnect'; +import Logger from '../../../util/Logger'; const REVIEW = 'review'; const EDIT = 'edit'; @@ -220,6 +221,7 @@ class Approval extends PureComponent { Alert.alert(strings('transactions.transaction_error'), error && error.message, [ { text: strings('navigation.ok') } ]); + Logger.error(error, 'error while trying to send transaction (Approval)'); this.setState({ transactionHandled: false }); } this.trackOnConfirm(); diff --git a/app/components/Views/ApproveView/Approve/index.js b/app/components/Views/ApproveView/Approve/index.js index 3f85bb559b0..adbc853d780 100644 --- a/app/components/Views/ApproveView/Approve/index.js +++ b/app/components/Views/ApproveView/Approve/index.js @@ -37,6 +37,7 @@ import IonicIcon from 'react-native-vector-icons/Ionicons'; import TransactionReviewDetailsCard from '../../../UI/TransactionReview/TransactionReivewDetailsCard'; import StyledButton from '../../../UI/StyledButton'; import currencySymbols from '../../../../util/currency-symbols.json'; +import Logger from '../../../../util/Logger'; const { BNToHex, hexToBN } = util; const styles = StyleSheet.create({ @@ -664,6 +665,7 @@ class Approve extends PureComponent { this.trackApproveEvent(ANALYTICS_EVENT_OPTS.DAPP_APPROVE_SCREEN_APPROVE); } catch (error) { Alert.alert(strings('transactions.transaction_error'), error && error.message, [{ text: 'OK' }]); + Logger.error(error, 'error while trying to send transaction (Approve)'); this.setState({ transactionHandled: false }); } }; diff --git a/app/components/Views/Send/index.js b/app/components/Views/Send/index.js index a80d02e6bf6..fad55dc93ca 100644 --- a/app/components/Views/Send/index.js +++ b/app/components/Views/Send/index.js @@ -534,6 +534,7 @@ class Send extends PureComponent { Alert.alert(strings('transactions.transaction_error'), error && error.message, [ { text: strings('navigation.ok') } ]); + Logger.error(error, 'error while trying to send transaction (Send)'); this.setState({ transactionConfirmed: false }); await this.reset(); } diff --git a/app/components/Views/SendFlow/Confirm/index.js b/app/components/Views/SendFlow/Confirm/index.js index 77c38c0a6e0..c8478052600 100644 --- a/app/components/Views/SendFlow/Confirm/index.js +++ b/app/components/Views/SendFlow/Confirm/index.js @@ -801,6 +801,7 @@ class Confirm extends PureComponent { Alert.alert(strings('transactions.transaction_error'), error && error.message, [ { text: strings('navigation.ok') } ]); + Logger.error(error, 'error while trying to send transaction (Confirm)'); } this.setState({ transactionConfirmed: false }); };