diff --git a/src/internals/index.js b/src/internals/index.js index 71499d21..9d429c07 100644 --- a/src/internals/index.js +++ b/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 diff --git a/src/main/index.js b/src/main/index.js index efda3b7a..36cc6b0b 100644 --- a/src/main/index.js +++ b/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() } diff --git a/src/renderer/index.js b/src/renderer/index.js index 1a230513..5464977b 100644 --- a/src/renderer/index.js +++ b/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)) }