aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-04-30 23:38:12 +0800
committerGitHub <noreply@github.com>2018-04-30 23:38:12 +0800
commit755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b (patch)
tree8a61061ff957df0406c91174ce3dea740f08ea43
parentdaaaab3ab06688cc7b3d349ce436c59909f54f5c (diff)
parentaa3dc83bf046d4c84d83976238c032dfeb953014 (diff)
downloadtangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.tar
tangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.tar.gz
tangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.tar.bz2
tangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.tar.lz
tangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.tar.xz
tangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.tar.zst
tangerine-wallet-browser-755d4945f7b69fe2bbe936f51dcecd8fa93dbe7b.zip
Merge pull request #4132 from MetaMask/master
Master
-rw-r--r--app/scripts/background.js6
-rw-r--r--app/scripts/lib/setupRaven.js37
2 files changed, 25 insertions, 18 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 38b871bb5..69d549c85 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -261,7 +261,11 @@ function setupController (initState, initLangCode) {
controller.txController.on(`tx:status-update`, (txId, status) => {
if (status !== 'failed') return
const txMeta = controller.txController.txStateManager.getTx(txId)
- reportFailedTxToSentry({ raven, txMeta })
+ try {
+ reportFailedTxToSentry({ raven, txMeta })
+ } catch (e) {
+ console.error(e)
+ }
})
// setup state persistence
diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js
index 9ec9a256f..48b941c3d 100644
--- a/app/scripts/lib/setupRaven.js
+++ b/app/scripts/lib/setupRaven.js
@@ -24,19 +24,20 @@ function setupRaven(opts) {
transport: function(opts) {
const report = opts.data
// simplify certain complex error messages
- report.exception.values.forEach(item => {
- let errorMessage = item.value
- // simplify ethjs error messages
- errorMessage = extractEthjsErrorMessage(errorMessage)
- // simplify 'Transaction Failed: known transaction'
- if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) {
- // cut the hash from the error message
- errorMessage = 'Transaction Failed: known transaction'
- }
- // finalize
- item.value = errorMessage
- })
-
+ if (report.exception && report.exception.values) {
+ report.exception.values.forEach(item => {
+ let errorMessage = item.value
+ // simplify ethjs error messages
+ errorMessage = extractEthjsErrorMessage(errorMessage)
+ // simplify 'Transaction Failed: known transaction'
+ if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) {
+ // cut the hash from the error message
+ errorMessage = 'Transaction Failed: known transaction'
+ }
+ // finalize
+ item.value = errorMessage
+ })
+ }
// modify report urls
rewriteReportUrls(report)
// make request normally
@@ -52,11 +53,13 @@ function rewriteReportUrls(report) {
// update request url
report.request.url = toMetamaskUrl(report.request.url)
// update exception stack trace
- report.exception.values.forEach(item => {
- item.stacktrace.frames.forEach(frame => {
- frame.filename = toMetamaskUrl(frame.filename)
+ if (report.exception && report.exception.values) {
+ report.exception.values.forEach(item => {
+ item.stacktrace.frames.forEach(frame => {
+ frame.filename = toMetamaskUrl(frame.filename)
+ })
})
- })
+ }
}
function toMetamaskUrl(origUrl) {