mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
fix(GUI): only enable error reporting if running inside an asar (#603)
Currently, TrackJS would receive errors when running Etcher locally. Most of the errors reported from those environments are due to developing Etcher, and create a lot of noise in TrackJS. With this PR, we ensure Etcher will only report errors when running inside an `asar` archive, which means its a "packaged" Etcher version. Change-Type: patch Changelog-Entry: Only enable error reporting if running inside an `asar`. Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
dd5d3e9e8d
commit
54909d267d
@ -23,6 +23,7 @@
|
||||
const _ = require('lodash');
|
||||
const angular = require('angular');
|
||||
const username = require('username');
|
||||
const isRunningInAsar = require('electron-is-running-in-asar');
|
||||
const app = require('electron').remote.app;
|
||||
const packageJSON = require('../../../package.json');
|
||||
|
||||
@ -78,7 +79,7 @@ analytics.config(($provide) => {
|
||||
return (exception, cause) => {
|
||||
const SettingsModel = $injector.get('SettingsModel');
|
||||
|
||||
if (SettingsModel.get('errorReporting')) {
|
||||
if (SettingsModel.get('errorReporting') && isRunningInAsar()) {
|
||||
$window.trackJs.track(exception);
|
||||
}
|
||||
|
||||
@ -96,7 +97,7 @@ analytics.config(($provide) => {
|
||||
|
||||
const SettingsModel = $injector.get('SettingsModel');
|
||||
|
||||
if (SettingsModel.get('errorReporting')) {
|
||||
if (SettingsModel.get('errorReporting') && isRunningInAsar()) {
|
||||
$window.trackJs.console.debug(message);
|
||||
}
|
||||
|
||||
@ -144,7 +145,7 @@ analytics.service('AnalyticsService', function($log, $mixpanel, SettingsModel) {
|
||||
*/
|
||||
this.logEvent = (message, data) => {
|
||||
|
||||
if (SettingsModel.get('errorReporting')) {
|
||||
if (SettingsModel.get('errorReporting') && isRunningInAsar()) {
|
||||
|
||||
// Clone data before passing it to `mixpanel.track`
|
||||
// since this function mutates the object adding
|
||||
|
Loading…
x
Reference in New Issue
Block a user