From f6f99c12a285aed5062d6bf0b621f89155df6384 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 6 Feb 2018 17:40:21 +0100 Subject: [PATCH] Catch errors also in internals --- src/internals/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/internals/index.js b/src/internals/index.js index 2c64c3fc..1e5bae99 100644 --- a/src/internals/index.js +++ b/src/internals/index.js @@ -8,6 +8,12 @@ function sendEvent(type: string, data: any, options: Object = { kill: true }) { process.send({ type, data, options }) } +if (__PROD__ && __SENTRY_URL__) { + const Raven = require('raven') // eslint-disable-line global-require + const ravenConfig = { captureUnhandledRejections: true } + Raven.config(__SENTRY_URL__, ravenConfig).install() +} + // $FlowFixMe const func = require(`./${process.env.FORK_TYPE}`) // eslint-disable-line import/no-dynamic-require