Skip to content

Commit

Permalink
Set submission to nil if error occured during calculate_score
Browse files Browse the repository at this point in the history
  • Loading branch information
kiragrammel committed Nov 15, 2023
1 parent 6a302a9 commit 31d1712
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/remote_evaluation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ def create_and_score_submission(cause)
end
rescue Runner::Error::RunnerInUse => e
Rails.logger.debug { "Scoring a submission failed because the runner was already in use: #{e.message}" }
@submission = nil
{message: I18n.t('exercises.editor.runner_in_use'), status: 409}
rescue Runner::Error => e
Rails.logger.debug { "Runner error while scoring submission #{@submission.id}: #{e.message}" }
@submission = nil
{message: I18n.t('exercises.editor.depleted'), status: 503}
end

Expand Down

0 comments on commit 31d1712

Please sign in to comment.