Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- begin
- raise Exception.new("An Exception")
- rescue => e
- puts "Rescued an unspecified error: #{e.message}"
- end
- rescue Exception => e
- puts "Rescued an exception: #{e.message}"
- end
- # Displays "Rescued an exception: An Exception"
- begin
- begin
- raise StandardError.new("A nonstandard Error")
- rescue => e
- puts "Rescued an unspecified error: #{e.message}"
- end
- rescue Exception => e
- puts "Rescued an exception: #{e.message}"
- end
- # Displays "Rescued an unspecified error: A nonstandard Error"
Add Comment
Please, Sign In to add comment