Skip to content
Snippets Groups Projects
Unverified Commit 77fb9b67 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #4165 from paulkaplan/use-new-sentry-api

Use new sentry API provided by www, and use analytics ID from www
parents 19f5b196 50a91728
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ class ErrorBoundary extends React.Component {
// Display fallback UI
this.setState({
hasError: true,
errorId: window.Raven ? window.Raven.lastEventId() : null
errorId: window.Sentry ? window.Sentry.lastEventId() : null
});
// Log errors to analytics, separating supported browsers from unsupported.
......@@ -37,8 +37,13 @@ class ErrorBoundary extends React.Component {
action: this.props.action,
label: error.message
});
if (window.Raven) {
window.Raven.captureException(error, {extra: info});
if (window.Sentry) {
window.Sentry.withScope(scope => {
Object.keys(info).forEach(key => {
scope.setExtra(key, info[key]);
});
window.Sentry.captureException(error);
});
}
} else {
analytics.event({
......
import GoogleAnalytics from 'react-ga';
GoogleAnalytics.initialize(process.env.GA_ID, {
GoogleAnalytics.initialize(process.env.GA_ID || window.GA_ID, {
debug: (process.env.NODE_ENV !== 'production'),
titleCase: true,
sampleRate: (process.env.NODE_ENV === 'production') ? 100 : 0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment