Skip to content

Instantly share code, notes, and snippets.

@gorsuch
Created December 31, 2011 20:34
Show Gist options
  • Save gorsuch/1545267 to your computer and use it in GitHub Desktop.
Save gorsuch/1545267 to your computer and use it in GitHub Desktop.
exception examination
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