From 427ee3e2e72219f43e3d04a76692e0076aed2aa9 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Thu, 5 Mar 2020 13:03:47 +0100 Subject: [PATCH] Stringify error messages for Sentry --- app/assets/javascripts/editor/ajax.js | 2 +- app/assets/javascripts/editor/editor.js.erb | 4 ++-- app/assets/javascripts/exercises.js.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/editor/ajax.js b/app/assets/javascripts/editor/ajax.js index bcd79ffa..731b3b12 100644 --- a/app/assets/javascripts/editor/ajax.js +++ b/app/assets/javascripts/editor/ajax.js @@ -12,6 +12,6 @@ CodeOceanEditorAJAX = { $.flash.danger({ text: message.length > 0 ? message : $('#flash').data('message-failure') }); - Sentry.captureException(response); + Sentry.captureException(JSON.stringify(response)); } }; \ No newline at end of file diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index bfcf6ac9..7d6584aa 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -572,7 +572,7 @@ configureEditors: function () { icon: ['fa', 'fa-bug'], text: $('#run').data('message-failure') }); - Sentry.captureException(output); + Sentry.captureException(JSON.stringify(output)); } }, @@ -622,7 +622,7 @@ configureEditors: function () { $.flash.danger({ text: $('#flash').data('message-failure') }); - Sentry.captureException(error); + Sentry.captureException(JSON.stringify(error)); }, showFileDialog: function(event) { diff --git a/app/assets/javascripts/exercises.js.erb b/app/assets/javascripts/exercises.js.erb index 9b47729e..e24f0b7e 100644 --- a/app/assets/javascripts/exercises.js.erb +++ b/app/assets/javascripts/exercises.js.erb @@ -112,7 +112,7 @@ $(document).on('turbolinks:load', function() { $.flash.danger({ text: $('#flash').data('message-failure') }); - Sentry.captureException(error); + Sentry.captureException(JSON.stringify(error)); }; var buildCheckboxes = function() {