Skip to content

Instantly share code, notes, and snippets.

@ronny
Created June 21, 2011 01:30
Show Gist options
  • Save ronny/1037040 to your computer and use it in GitHub Desktop.
Save ronny/1037040 to your computer and use it in GitHub Desktop.
`rescue => e` defaults to StandardError and its descendants
begin
raise NotImplementedError, "this will not be rescued"
puts "this will never be printed"
rescue => e
puts "A #{e.inspect} has been rescued."
end
# Would result in:
# in `<main>': this will not be rescued (NotImplementedError)
# See also: http://blog.nicksieger.com/articles/2006/09/06/rubys-exception-hierarchy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment