Record fatal error boundary hits to analytics
This commit is contained in:
1 parent
e3114c1392
commit
afe84d52cc
1 file changed
+6
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import platform from 'platform';
|
||||
import BrowserModalComponent from '../components/browser-modal/browser-modal.jsx';
|
||||
import log from '../lib/log.js';
|
||||
import analytics from '../lib/analytics';
|
||||
|
||||
class ErrorBoundary extends React.Component {
|
||||
constructor (props) {
|
||||
@@ -16,6 +17,11 @@ class ErrorBoundary extends React.Component {
|
||||
// Display fallback UI
|
||||
this.setState({hasError: true});
|
||||
log.error(`Unhandled Error: ${error}, info: ${info}`);
|
||||
analytics.event({
|
||||
category: 'error',
|
||||
action: 'Fatal Error',
|
||||
label: error.message
|
||||
});
|
||||
}
|
||||
|
||||
handleBack () {
|
||||
|
||||
Reference in new issue
Block a user