Created
August 22, 2013 19:29
-
-
Save scudelletti/6311712 to your computer and use it in GitHub Desktop.
Handling Exceptions
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
puts "Getting the Exception 1" | |
begin | |
eval("1+") | |
rescue Exception => e | |
puts "Exception Class => #{e.class} - Message: #{e}" | |
end | |
puts "Getting the Exception 2" | |
begin | |
eval("1+") | |
rescue => e | |
puts "Exception Class => #{e.class} - Message: #{e}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment