commit 4b891123a6286d793fef2634cf1caea4a422deaf parent 93abed5c55091c18d4b5d2a6de6d7ac89afa9af9 Author: Sergej Orlov <wladimirych@gmail.com> Date: Mon, 6 Mar 2017 22:22:36 +0300 made promises rejection tracking compatible with polyfill from core-js Diffstat:
M | src/index.js | | | 14 | ++++++++++++-- |
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/index.js b/src/index.js @@ -4,13 +4,23 @@ import App from './App' import config from './config'; Raven.config(config.sentryDSN).install(); -window.addEventListener('unhandledrejection', (e) => { + +const oldOnunhandledrejection = window.onunhandledrejection; + +// Not using addEventListener due to https://github.com/zloirock/core-js/issues/205 +window.onunhandledrejection = (e) => { + let result = true; + if (oldOnunhandledrejection) { + result = oldOnunhandledrejection(e); + } + console.error('Uncaught in promise:', e.reason); const err = e.reason; if (err.name) { err.name = 'Uncaught in promise: ' + err.name; } Raven.captureException(err); -}); + return result; +}; App.setUp();