fix(GUI): avoid duplicated TrackJS errors (#1176)

I've noticed that errors reported to TrackJS appear twice. Turns out
that TrackJS pipes output of `console.error()` as errors, rather than as
extra logging.

The `AnalyticsService.logException()` function reports the exception to
TrackJS using `$window.trackJS.track()`, but then prints it to `stderr`
as well (so it appears on DevTools), causing TrackJS to report that one
too.

The solution is to disable the `console.error` boolean property of the
`_trackJs` object. From the TrackJS documentation:

```
// By default any calls to console.error() will automatically trigger an
// error. Set this to false if you don't want console.error() to
// trigger errors.
error: true,
```

See: http://docs.trackjs.com/tracker/configuration
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-03-13 11:00:26 -04:00 committed by GitHub
parent ee2bbef9da
commit 2342831104

View File

@ -14,7 +14,10 @@
<script>
window._trackJs = {
token: '032448bc3d9e4cffb1e9b43d29d6c142',
application: 'etcher'
application: 'etcher',
console: {
error: false
}
};
</script>
<script src="../../node_modules/trackjs/tracker.js"></script>