File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class ErrorBoundary extends React.Component {
2727 // Display fallback UI
2828 this . setState ( {
2929 hasError : true ,
30- errorId : window . Raven ? window . Raven . lastEventId ( ) : null
30+ errorId : window . Sentry ? window . Sentry . lastEventId ( ) : null
3131 } ) ;
3232
3333 // Log errors to analytics, separating supported browsers from unsupported.
@@ -37,8 +37,13 @@ class ErrorBoundary extends React.Component {
3737 action : this . props . action ,
3838 label : error . message
3939 } ) ;
40- if ( window . Raven ) {
41- window . Raven . captureException ( error , { extra : info } ) ;
40+ if ( window . Sentry ) {
41+ window . Sentry . withScope ( scope => {
42+ Object . keys ( info ) . forEach ( key => {
43+ scope . setExtra ( key , info [ key ] ) ;
44+ } ) ;
45+ window . Sentry . captureException ( error ) ;
46+ } ) ;
4247 }
4348 } else {
4449 analytics . event ( {
Original file line number Diff line number Diff line change 11import GoogleAnalytics from 'react-ga' ;
22
3- GoogleAnalytics . initialize ( process . env . GA_ID , {
3+ GoogleAnalytics . initialize ( process . env . GA_ID || window . GA_ID , {
44 debug : ( process . env . NODE_ENV !== 'production' ) ,
55 titleCase : true ,
66 sampleRate : ( process . env . NODE_ENV === 'production' ) ? 100 : 0 ,
You can’t perform that action at this time.
0 commit comments