Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Forked from danielfone/gist:5689016
Created February 1, 2014 21:19
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 jondkinney/8759068 to your computer and use it in GitHub Desktop.
Save jondkinney/8759068 to your computer and use it in GitHub Desktop.
MyExceptions = [RangeError, RegexpError, IOError].freeze
begin
raise IOError, "should be rescued"
rescue *MyExceptions => e
puts e
end
@jondkinney
Copy link
Author

To rescue a certain set of exceptions for balanced, instead of just rescuing everything with Exception => e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment