Skip to content

Instantly share code, notes, and snippets.

@maxjacobson
Created October 10, 2017 03:00
Show Gist options
  • Save maxjacobson/e807c26444810aec1d2b0f4a91d03213 to your computer and use it in GitHub Desktop.
Save maxjacobson/e807c26444810aec1d2b0f4a91d03213 to your computer and use it in GitHub Desktop.
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