Integrating Sentry for JS error tracking

This commit is contained in:
Jeff Avallone
2017-07-29 17:36:46 -04:00
parent fac820aecd
commit 90253b69c9
4 changed files with 13 additions and 14 deletions
-14
View File
@@ -11,20 +11,6 @@ import Parser from './parser/javascript.js';
import _ from 'lodash';
(function() {
// Global error handler that will send unhandled JavaScript exceptions and
// stack-traces to Google Analytics. This data can be used to find errors in
// code that were not found during testing.
window.addEventListener('error', function(error) {
if (error.lineno !== 0) {
util.track('send', 'event', 'global', 'exception',
`${error.filename}(${error.lineno},${error.colno}): ${error.message}`);
if (typeof error.error !== 'undefined' && typeof error.error.stack !== 'undefined') {
util.track('send', 'event', 'global', 'stack trace', error.error.stack);
}
}
});
// Initialize the main page of the site. Functionality is kept in the
// [Regexper class](./regexper.html).
if (document.body.querySelector('#content .application')) {