move logging statement up to be sure that its result is not assigned to matching_exercise if an error might be thrown.

This commit is contained in:
Ralf Teusner
2018-08-15 15:43:37 +02:00
parent 5a90d20e54
commit 400eef3118

View File

@ -36,8 +36,8 @@ class ProxyExercise < ActiveRecord::Base
Rails.logger.debug("retrieved assigned exercise for user #{user.id}: Exercise #{assigned_user_proxy_exercise.exercise}" )
assigned_user_proxy_exercise.exercise
else
Rails.logger.debug("find new matching exercise for user #{user.id}" )
matching_exercise =
Rails.logger.debug("find new matching exercise for user #{user.id}" )
begin
find_matching_exercise(user)
rescue => e #fallback