Created
October 10, 2017 03:00
-
-
Save maxjacobson/e807c26444810aec1d2b0f4a91d03213 to your computer and use it in GitHub Desktop.
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
require "English" | |
def some_method | |
# I didn't know it would still be set here | |
$ERROR_INFO # => #<RuntimeError: hell> | |
end | |
begin | |
raise "hell" | |
rescue | |
some_method | |
# I kinda knew it would still be set here, which | |
# enables you to write just `raise` and ruby will re-raise the rescued | |
# exception | |
$ERROR_INFO # => #<RuntimeError: hell> | |
end | |
# I think it makes sense it's not defined here | |
$ERROR_INFO # => nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment