A nice way of not keeping track of retry counter and not using a loop
3.times do
begin
raise "Nope"
rescue
puts "Failed"
else
puts "Success"
break
end
end
A nice way of not keeping track of retry counter and not using a loop
3.times do
begin
raise "Nope"
rescue
puts "Failed"
else
puts "Success"
break
end
end