Last active
May 23, 2018 15:48
-
-
Save softcraft-development/8ef051d7340954e5acfc3e26103af4ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment