Skip to content

Instantly share code, notes, and snippets.

@ascruggs
Created December 3, 2009 16:28
Show Gist options
  • Save ascruggs/248304 to your computer and use it in GitHub Desktop.
Save ascruggs/248304 to your computer and use it in GitHub Desktop.
# 1. explicitly assign the exception to a variable
begin
raise "boom"
rescue StandardError => e
puts e.message
end
# 2. use the global variable
begin
raise "boom"
rescue StandardError
puts $!.message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment