Skip to content

Commit

Permalink
raise arguement error if uninitialized constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Agraj Garg authored and Agraj Garg committed Feb 9, 2024
1 parent e4ad9cb commit 679eada
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/shoryuken/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ def polling_strategy(group)
when 'StrictPriority'
Polling::StrictPriority
when String
begin
Object.const_get(strategy)
rescue NameError
raise ArgumentError, "#{strategy} is not a valid polling_strategy"
end
when Class
strategy
else
raise ArgumentError, "#{strategy} is not a valid polling_strategy"
end
end

Expand Down

0 comments on commit 679eada

Please sign in to comment.