sentry - add detection for Brave Browser

feature/default_network_editable
Jenny Pollack 6 years ago
parent 13804d61b4
commit 1a9748667d
  1. 6
      app/scripts/background.js
  2. 9
      app/scripts/lib/setupRaven.js

@ -27,6 +27,7 @@ const EdgeEncryptor = require('./edge-encryptor')
const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code') const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code')
const getObjStructure = require('./lib/getObjStructure') const getObjStructure = require('./lib/getObjStructure')
const ipfsContent = require('./lib/ipfsContent.js') const ipfsContent = require('./lib/ipfsContent.js')
const assert = require('assert')
const { const {
ENVIRONMENT_TYPE_POPUP, ENVIRONMENT_TYPE_POPUP,
@ -44,8 +45,9 @@ const notificationManager = new NotificationManager()
global.METAMASK_NOTIFIER = notificationManager global.METAMASK_NOTIFIER = notificationManager
// setup sentry error reporting // setup sentry error reporting
const release = platform.getVersion() const releaseVersion = platform.getVersion()
const raven = setupRaven({ release }) const raven = setupRaven({ releaseVersion })
assert.equal('test', 'notest')
// browser check if it is Edge - https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser // browser check if it is Edge - https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Internet Explorer 6-11 // Internet Explorer 6-11

@ -8,8 +8,10 @@ module.exports = setupRaven
// Setup raven / sentry remote error reporting // Setup raven / sentry remote error reporting
function setupRaven (opts) { function setupRaven (opts) {
const { release } = opts const { releaseVersion } = opts
let ravenTarget let ravenTarget
// detect brave
const isBrave = Boolean(window.chrome.ipcRenderer)
if (METAMASK_DEBUG) { if (METAMASK_DEBUG) {
console.log('Setting up Sentry Remote Error Reporting: DEV') console.log('Setting up Sentry Remote Error Reporting: DEV')
@ -20,10 +22,13 @@ function setupRaven (opts) {
} }
const client = Raven.config(ravenTarget, { const client = Raven.config(ravenTarget, {
release, releaseVersion,
transport: function (opts) { transport: function (opts) {
opts.data.extra.isBrave = isBrave
const report = opts.data const report = opts.data
try { try {
console.log('testing opts in transport sentry')
// handle error-like non-error exceptions // handle error-like non-error exceptions
rewriteErrorLikeExceptions(report) rewriteErrorLikeExceptions(report)
// simplify certain complex error messages (e.g. Ethjs) // simplify certain complex error messages (e.g. Ethjs)

Loading…
Cancel
Save