Created
December 31, 2011 20:34
-
-
Save gorsuch/1545267 to your computer and use it in GitHub Desktop.
exception examination
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
def explode! | |
fail "shit man!" | |
end | |
def run | |
explode! | |
rescue => e | |
# this is the main text of the exception | |
puts e.message | |
# this is the backtrace, which is an array that you can play with | |
puts e.backtrace | |
# this is the type of exception | |
puts e.class | |
end | |
run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment