Skip to content

Instantly share code, notes, and snippets.

@jjb
Created May 13, 2012 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjb/2686448 to your computer and use it in GitHub Desktop.
Save jjb/2686448 to your computer and use it in GitHub Desktop.
Bare ruby rescue handles StandardError and its descendants
class SpecialError < StandardError; end
begin
raise StandardError
rescue
"rescued"
end
# "rescued"
begin
raise SpecialError
rescue
"rescued"
end
# "rescued"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment