Created
May 13, 2012 06:17
-
-
Save jjb/2686448 to your computer and use it in GitHub Desktop.
Bare ruby rescue handles StandardError and its descendants
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
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