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

Use new sentry API provided by www, and use analytics ID from www
This commit is contained in:
Paul Kaplan authored and GitHub committed 2018-12-20 12:58:31 -05:00
commit 77fb9b67a7
2 files changed
+9 -4

No files matched your search

+8 -3
View File
@@ -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({
+1 -1
View File
@@ -1,6 +1,6 @@
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,