diff options
author | frankiebee <frankie.diamond@gmail.com> | 2018-04-30 04:46:07 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2018-04-30 04:46:07 +0800 |
commit | 873f85d9962ff569baa8a5bbf2c1337c3b920419 (patch) | |
tree | e20e8628e1c64a24bf64597670ee99b7bf23d99a /app/scripts/lib/setupRaven.js | |
parent | 4e7b0ff15c5a57cd58497aa292c884a97e8a5d23 (diff) | |
download | tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.tar tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.tar.gz tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.tar.bz2 tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.tar.lz tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.tar.xz tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.tar.zst tangerine-wallet-browser-873f85d9962ff569baa8a5bbf2c1337c3b920419.zip |
guard adainst raven erroring
Diffstat (limited to 'app/scripts/lib/setupRaven.js')
-rw-r--r-- | app/scripts/lib/setupRaven.js | 37 |
1 files changed, 20 insertions, 17 deletions
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) { |