Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MyExceptions = [RangeError, RegexpError, IOError].freeze
begin
raise IOError, "should be rescued"
rescue *MyExceptions => e
puts e
end
@jondkinney

This comment has been minimized.

Copy link
Owner Author

commented Feb 1, 2014

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
You can’t perform that action at this time.