Created
April 23, 2012 08:06
-
-
Save dmeremyanin/2469451 to your computer and use it in GitHub Desktop.
re-raise
This file contains 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 re(f = false) | |
begin | |
yield | |
rescue => e | |
p e.__id__ | |
f ? raise(e) : raise | |
end | |
end | |
e = StandardError.new | |
p e.__id__ | |
begin | |
re { raise(e) } | |
rescue => e | |
p e.__id__ | |
end | |
begin | |
re(true) { raise(e) } | |
rescue => e | |
p e.__id__ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment