From: Tim Hunter Date: 2008-04-03T07:45:50+09:00 Subject: Re: ruby constructor return value? Brendan Stennett wrote: >> begin >> o = Zip.new('00000') >> rescue ArgumentError >> # deal with the error here >> end > > I was reading up on exception handling..but i dont understand that > difference between throw/catch blocks and begin/resuce blocks. My 2 > backgrounds (PHP and VB.NET) both seem to have similar structures in > Ruby. PHP had try/throw/catch blocks while ruby has throw/catch and > VB.NET has try/catch/finally while Ruby has begin/rescue/ensure. begin/rescue is for handling exceptions. throw/catch is for jumping out of a deeply nested construct during normal processing. -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html