Ruby - Error Handling
Identify the error in this Ruby code using retry:
begin puts 'Start' raise 'Oops' rescue puts 'Error caught' retry puts 'After retry' end
begin puts 'Start' raise 'Oops' rescue puts 'Error caught' retry puts 'After retry' end
retry statement causes the code to jump back to begin, so any code after retry in rescue is never run.puts 'After retry' is after retry and will never execute, making it unreachable.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions