From f6e8d09522b4a2e5d8a2b294bbd1f1528ebd3837 Mon Sep 17 00:00:00 2001 From: Quentin DECAUNES Date: Thu, 25 Jul 2019 13:51:32 +0200 Subject: [PATCH] Better Sentry implementation. --- js/app.js | 7 ++++++- js/methods.js | 1 + js/preset.js | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 65b9b23..fb636d8 100644 --- a/js/app.js +++ b/js/app.js @@ -1,5 +1,8 @@ ready(function(){ - Sentry.init({ dsn: 'https://f80fd3ea297141a8bdc04ce812762f39@sentry.io/1513427' }); + Sentry.init({ + dsn: 'https://f80fd3ea297141a8bdc04ce812762f39@sentry.io/1513427', + release: require('./package.json').version, + }); const settings = require('electron-settings'); const fixPath = require('fix-path'); document.isStarting = true; @@ -60,6 +63,7 @@ function applyRyzenSettings() { } catch (error) { notification('danger', `Unknown option "${option}".`); appendLog(`applyRyzenSettings(): ${error}`); + Sentry.captureException(new Error(`applyRyzenSettings(): ${error}`)); } if (options_data[option_name].ryzenadj_value_convert) { value = ryzenAdjConvert[ @@ -84,6 +88,7 @@ function applyRyzenSettings() { return setTimeout(applyRyzenSettings, 500); } notification('danger', err + '
' + output); + Sentry.captureException(new Error(err + ' - ' + output)); } else if (output) { notification('success', 'Ryzenadj output:
' + output); diff --git a/js/methods.js b/js/methods.js index 0192ba2..986d7e5 100644 --- a/js/methods.js +++ b/js/methods.js @@ -444,6 +444,7 @@ function recreateShortcut() { }); } catch (error) { appendLog(`recreateShortcut() ${error}`); + Sentry.captureException(`recreateShortcut() ${error}`); } } } diff --git a/js/preset.js b/js/preset.js index 10d7c83..2c41be6 100644 --- a/js/preset.js +++ b/js/preset.js @@ -23,7 +23,8 @@ function preset_import() { presetsToBeImported = JSON.parse(presetsToBeImported); } catch (e) { notification('danger', 'Unable to import presets, malformed data.'); - console.error(e); + appendLog(`preset_import() ${e}`); + Sentry.captureException(`recreateShortcut() ${e}`); return; }