Adding more detailed exception tracking

This commit is contained in:
Jeff Avallone 2015-01-01 12:24:11 -05:00
parent 491c9535a9
commit 0600d18bb5

View File

@ -9,12 +9,21 @@ window._gaq = (typeof _gaq !== 'undefined') ? _gaq : {
(function() { (function() {
window.addEventListener('error', function(error) { window.addEventListener('error', function(error) {
if (typeof error.error !== 'undefined' && typeof error.error.stack !== 'undefined') {
_gaq.push([ _gaq.push([
'_trackEvent', '_trackEvent',
'global', 'global',
'exception', 'exception',
`${error.filename}(${error.lineno}): ${error.message}` error.error.stack
]); ]);
} else if (error.filename !== '') {
_gaq.push([
'_trackEvent',
'global',
'exception',
`${error.filename}(${error.lineno},${error.colno}): ${error.message}`
]);
}
}); });
if (document.body.querySelector('#content .application')) { if (document.body.querySelector('#content .application')) {