Skip to content

Instantly share code, notes, and snippets.

@tagomoris
Created November 7, 2016 09:54
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 tagomoris/4cc038b544e0413ab9c532f50818c5b8 to your computer and use it in GitHub Desktop.
Save tagomoris/4cc038b544e0413ab9c532f50818c5b8 to your computer and use it in GitHub Desktop.
variable not assigned by errors is nil.
def foo
raise "yay"
end
def hoge
tag = foo
rescue => e
{tag: tag, e: e}
end
hoge #=> {:tag=>nil, :e=>#<RuntimeError: yay>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment