How to use the @sentry/browser.lastEventId function in @sentry/browser

To help you get started, we’ve selected a few @sentry/browser 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 LLK / scratch-www / src / components / errorboundary / errorboundary.jsx View on Github external
componentDidCatch (error, errorInfo) {
        // Display fallback UI
        Sentry.withScope(scope => {
            Object.keys(errorInfo).forEach(key => {
                scope.setExtra(key, errorInfo[key]);
            });
            Sentry.captureException(error);
        });
        this.setState({
            hasError: true,
            errorId: Sentry.lastEventId()
        });
        log.error(`Unhandled Error: ${error}, info: ${errorInfo}`);
    }
github getsentry / sentry / src / sentry / static / sentry / app / components / errors / detailedError.tsx View on Github external
<div>{message}</div>

          {showFooter &amp;&amp; (
            <div>
              <div>
                {onRetry &amp;&amp; (
                  <a>
                    {t('Retry')}
                  </a>
                )}
              </div>

              {!hideSupportLinks &amp;&amp; (
                <div>
                  {Sentry.lastEventId() &amp;&amp; (
                    <button>
                      {t('Fill out a report')}
                    </button>
                  )}
                  <a href="https://status.sentry.io/">{t('Service status')}</a>

                  <a href="https://sentry.io/support/">{t('Contact support')}</a>
                </div>
              )}
            </div>
          )}
        
      
    );
  }
}