sentry - report failed txs

feature/default_network_editable
kumavis 7 years ago
parent 0373a3840b
commit b91e2b5eb1
  1. 12
      app/scripts/background.js
  2. 2
      app/scripts/setupRaven.js

@ -27,7 +27,7 @@ global.METAMASK_NOTIFIER = notificationManager
// setup sentry error reporting // setup sentry error reporting
const release = platform.getVersion() const release = platform.getVersion()
setupRaven({ release }) const raven = setupRaven({ release })
let popupIsOpen = false let popupIsOpen = false
@ -77,6 +77,16 @@ function setupController (initState) {
}) })
global.metamaskController = controller global.metamaskController = controller
// report failed transactions to Sentry
controller.txController.on(`tx:status-update`, (txId, status) => {
if (status !== 'failed') return
const txMeta = controller.txController.txStateManager.getTx(txId)
raven.captureMessage('Transaction Failed', {
// "extra" key is required by Sentry
extra: txMeta,
})
})
// setup state persistence // setup state persistence
pump( pump(
asStream(controller.store), asStream(controller.store),

@ -21,4 +21,6 @@ function setupRaven(opts) {
Raven.config(ravenTarget, { Raven.config(ravenTarget, {
release, release,
}).install() }).install()
return Raven
} }

Loading…
Cancel
Save