From ad199c3faa0bdda1829a561b7957993d97e93c4b Mon Sep 17 00:00:00 2001 From: Quentin DECAUNES Date: Thu, 1 Aug 2019 12:08:39 +0200 Subject: [PATCH] fix: Avoid sentry noise by shortening source file path. --- js/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/app.js b/js/app.js index fb636d8..10ca772 100644 --- a/js/app.js +++ b/js/app.js @@ -2,6 +2,17 @@ ready(function(){ Sentry.init({ dsn: 'https://f80fd3ea297141a8bdc04ce812762f39@sentry.io/1513427', release: require('./package.json').version, + beforeSend: (event) => { + event.exception.values = event.exception.values.map((value) => { + value.stacktrace.frames = value.stacktrace.frames.map((frame) => { + frame.filename = frame.filename.replace(/^.*ryzen(|-)controller\//g, ""); + return frame; + }) + return value; + }); + event.request.url = event.request.url.replace(/^.*ryzen(|-)controller\//g, "") + return event; + } }); const settings = require('electron-settings'); const fixPath = require('fix-path');