Skip to content

Instantly share code, notes, and snippets.

@jamesdabbs
Created September 12, 2013 14:12
Show Gist options
  • Save jamesdabbs/6538069 to your computer and use it in GitHub Desktop.
Save jamesdabbs/6538069 to your computer and use it in GitHub Desktop.
Rescuing multiple exception classes
begin
i = rand(2)
i == 0 ? ([] + '') : (foo)
rescue TypeError, NameError => e
puts "oops: #{e.message}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment