Ruby - Error Handling
Find the error in this Ruby code snippet:
begin raise 'Oops!' rescue IOError puts 'IO error caught' end
Find the error in this Ruby code snippet:
begin raise 'Oops!' rescue IOError puts 'IO error caught' end
'Oops!' creates a RuntimeError by default.IOError, but the raised error is RuntimeError, so it is not caught.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions