How to use the @commercetools-frontend/actions-global.showUnexpectedErrorNotification function in @commercetools-frontend/actions-global

To help you get started, weā€™ve selected a few @commercetools-frontend/actions-global examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / src / utils / setup-global-error-listener / setup-global-error-listener.js View on Github external
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 } })
    );
  });
github commercetools / merchant-center-application-kit / packages / application-shell / src / utils / setup-global-error-listener / setup-global-error-listener.js View on Github external
window.addEventListener('error', errorEvent => {
    internalReduxStore.dispatch(
      showUnexpectedErrorNotification({ error: errorEvent })
    );
  });
}