From 6a942ccf5082abde17635a8d159168dc7b2c398d Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Fri, 23 Dec 2022 13:04:28 +0100 Subject: [PATCH] Capture exception for Scoring Previously, an exception was caused by the tubesock gem but not sent to Sentry. This caused errors not to bubble up correctly but rather kill the current thread, leaving the user with a generic "WebSocket connection not established" message. Probably, this should be removed when updating the WebSocket implementation. --- app/controllers/submissions_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb index df50fa5d..bfbe6cf5 100644 --- a/app/controllers/submissions_controller.rb +++ b/app/controllers/submissions_controller.rb @@ -248,6 +248,11 @@ class SubmissionsController < ApplicationController Rails.logger.debug { "Runner error while scoring submission #{@submission.id}: #{e.message}" } @testrun[:passed] = false save_testrun_output 'assess' + rescue StandardError => e + Sentry.capture_exception(e) + raise e + ensure + ActiveRecord::Base.connection_pool.release_connection end end end