aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-10-20 15:14:59 +0800
committerkumavis <aaron@kumavis.me>2018-10-20 15:14:59 +0800
commit73ec4e66cb7a476d01371a61692b0d8d9224da04 (patch)
tree96c2b2b20030e63eebbf0f08e669091968f1a223 /app/scripts
parente3fda83ab209af7836ba93bfaba215c271d73e8a (diff)
downloadtangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.gz
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.bz2
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.lz
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.xz
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.zst
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.zip
sentry - include app state in ui errors
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/lib/setupSentry.js8
-rw-r--r--app/scripts/ui.js12
2 files changed, 18 insertions, 2 deletions
diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js
index aa8d72194..69042bc19 100644
--- a/app/scripts/lib/setupSentry.js
+++ b/app/scripts/lib/setupSentry.js
@@ -8,7 +8,7 @@ module.exports = setupSentry
// Setup sentry remote error reporting
function setupSentry (opts) {
- const { release } = opts
+ const { release, getState } = opts
let sentryTarget
// detect brave
const isBrave = Boolean(window.chrome.ipcRenderer)
@@ -38,9 +38,15 @@ function setupSentry (opts) {
simplifyErrorMessages(report)
// modify report urls
rewriteReportUrls(report)
+ // append app state
+ if (getState) {
+ const appState = getState()
+ report.extra.appState = appState
+ }
} catch (err) {
console.warn(err)
}
+ return report
}
return Sentry
diff --git a/app/scripts/ui.js b/app/scripts/ui.js
index 8893ceaad..c4f6615db 100644
--- a/app/scripts/ui.js
+++ b/app/scripts/ui.js
@@ -21,7 +21,17 @@ async function start () {
// setup sentry error reporting
const release = global.platform.getVersion()
- setupSentry({ release })
+ setupSentry({ release, getState })
+ // provide app state to append to error logs
+ function getState() {
+ // get app state
+ const state = window.getCleanAppState()
+ // remove unnecessary data
+ delete state.localeMessages
+ delete state.metamask.recentBlocks
+ // return state to be added to request
+ return state
+ }
// inject css
// const css = MetaMaskUiCss()