Browse Source

__SENTRY_URL__ > process.env.SENTRY_URL

master
Loëck Vézien 7 years ago
parent
commit
2175e78afe
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 6
      src/internals/index.js
  2. 6
      src/main/index.js
  3. 6
      src/renderer/index.js

6
src/internals/index.js

@ -5,7 +5,7 @@ import capitalize from 'lodash/capitalize'
import cpuUsage from 'helpers/cpuUsage'
const { FORK_TYPE } = process.env
const { FORK_TYPE, SENTRY_URL } = process.env
process.title = `${require('../../package.json').productName} ${capitalize(FORK_TYPE)}` // eslint-disable-line global-require
@ -13,10 +13,10 @@ function sendEvent(type: string, data: any, options: Object = { kill: true }) {
process.send({ type, data, options })
}
if (__PROD__ && __SENTRY_URL__) {
if (__PROD__ && SENTRY_URL) {
const Raven = require('raven') // eslint-disable-line global-require
const ravenConfig = { captureUnhandledRejections: true }
Raven.config(__SENTRY_URL__, ravenConfig).install()
Raven.config(SENTRY_URL, ravenConfig).install()
}
// $FlowFixMe

6
src/main/index.js

@ -9,8 +9,10 @@ require('./app')
setImmediate(() => require('./bridge')) // eslint-disable-line global-require
if (__PROD__ && __SENTRY_URL__) {
const { SENTRY_URL } = process.env
if (__PROD__ && SENTRY_URL) {
const Raven = require('raven') // eslint-disable-line global-require
const ravenConfig = { captureUnhandledRejections: true }
Raven.config(__SENTRY_URL__, ravenConfig).install()
Raven.config(SENTRY_URL, ravenConfig).install()
}

6
src/renderer/index.js

@ -23,8 +23,10 @@ import App from 'components/App'
import 'styles/global'
if (__PROD__ && __SENTRY_URL__) {
Raven.config(__SENTRY_URL__, { allowSecretKey: true }).install()
const { SENTRY_URL } = process.env
if (__PROD__ && SENTRY_URL) {
Raven.config(SENTRY_URL, { allowSecretKey: true }).install()
window.addEventListener('unhandledrejection', event => Raven.captureException(event.reason))
}

Loading…
Cancel
Save