Ruby: Continue a loop after catching an exception

In Ruby, continue is spelt next.


for i in 1..5
    begin
        do_something_that_might_raise_exceptions(i)
    rescue
        next    # do_something_* again, with the next i
    end
end

to print the exception:

rescue
        puts $!, $@
        next    # do_something_* again, with the next i
end