RosettaCodeData/Task/Flow-control-structures/Ruby/flow-control-structures-1.rb
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

13 lines
291 B
Ruby

begin
# some code that may raise an exception
rescue ExceptionClassA => a
# handle code
rescue ExceptionClassB, ExceptionClassC => b_or_c
# handle ...
rescue
# handle all other exceptions
else
# when no exception occurred, execute this code
ensure
# execute this code always
end