Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
window.addEventListener('unhandledrejection', event => {
if (process.env.NODE_ENV !== 'production')
// eslint-disable-next-line no-console
console.warn(
'An uncaught promise has been rejected and not properly ' +
'handled. This is most likely a bug in the software. Please ensure ' +
'that the promise is correctly handled.'
);
dispatch(
showUnexpectedErrorNotification({ error: { message: event.reason } })
);
});
window.addEventListener('error', errorEvent => {
internalReduxStore.dispatch(
showUnexpectedErrorNotification({ error: errorEvent })
);
});
}