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:
2 files changed
+9
-4
No files matched your search
@@ -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,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,
|
||||
|
||||
Reference in new issue
Block a user