diff --git a/opponents/monika/js/monika.js b/opponents/monika/js/monika.js index 67f95595725a55ee2bad44a60f534364bb9bf84c..6fc3e57e9dc3fd762fa51a109bea0303638ef5ca 100644 --- a/opponents/monika/js/monika.js +++ b/opponents/monika/js/monika.js @@ -3,7 +3,7 @@ if(!monika) var monika = (function (root) { var exports = {}; if (root.SENTRY_INITIALIZED) { - root.Sentry.setTag('monika_enabled', true); + root.Sentry.setTag('monika-enabled', true); root.Sentry.addBreadcrumb({ category: 'monika', message: 'Initializing monika.js...', @@ -50,7 +50,7 @@ function configureGlitchChance (mode) { $("#options-monika-glitches-2").removeClass("active"); $("#options-monika-glitches-3").removeClass("active"); - if (root.SENTRY_INITIALIZED) root.Sentry.setTag('monika_glitch_mode', mode); + if (root.SENTRY_INITIALIZED) root.Sentry.setTag('monika-glitch-mode', mode); switch (mode) { /* Off */ @@ -79,7 +79,6 @@ function configureGlitchChance (mode) { exports.configureGlitchChance = configureGlitchChance; configureGlitchChance(1); - function reportException(prefix, e) { console.log("[Monika] Exception swallowed "+prefix+": "); console.error(e); @@ -100,6 +99,14 @@ function reportException(prefix, e) { } if (USAGE_TRACKING) { + if (SENTRY_INITIALIZED) { + Sentry.withScope(function (scope) { + scope.setTag("monika-error", true); + scope.setExtra("where", prefix); + Sentry.captureException(e); + }); + } + var report = compileBaseErrorReport('Exception caught from Monika code.', 'auto'); $.ajax({