Ruby - Error Handling
What is the issue with this Ruby code snippet using
retry?
begin puts 'Processing' raise 'Error' rescue retry puts 'Recovered' end
retry?
begin puts 'Processing' raise 'Error' rescue retry puts 'Recovered' end
retry is executed, control jumps back to the begin block immediately.retry inside rescue will never run.puts 'Recovered' is unreachable and thus ineffective.puts 'Recovered' line is unreachable because retry restarts the block immediately. -> Option D15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions