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:
@ -36,8 +36,8 @@ class ProxyExercise < ActiveRecord::Base
|
|||||||
Rails.logger.debug("retrieved assigned exercise for user #{user.id}: Exercise #{assigned_user_proxy_exercise.exercise}" )
|
Rails.logger.debug("retrieved assigned exercise for user #{user.id}: Exercise #{assigned_user_proxy_exercise.exercise}" )
|
||||||
assigned_user_proxy_exercise.exercise
|
assigned_user_proxy_exercise.exercise
|
||||||
else
|
else
|
||||||
|
Rails.logger.debug("find new matching exercise for user #{user.id}" )
|
||||||
matching_exercise =
|
matching_exercise =
|
||||||
Rails.logger.debug("find new matching exercise for user #{user.id}" )
|
|
||||||
begin
|
begin
|
||||||
find_matching_exercise(user)
|
find_matching_exercise(user)
|
||||||
rescue => e #fallback
|
rescue => e #fallback
|
||||||
|
Reference in New Issue
Block a user