woensdag 29 april 2009

Try Catch Finally block in Ruby

For all the people with bad memory like me, here is the Ruby equivalent of the Try Catch Finally block:


begin
somecode()
rescue
puts "Error #{$!}"
ensure
this_code_will_execute_always()
end