From: Carl Jenkins Date: 2010-07-02T10:08:37+09:00 Subject: Re: Handling File.open exceptions Robert Klemme wrote: > On 01.07.2010 22:24, Carl Jenkins wrote: >> I was reading the pick axe book (for 1.9 version of ruby) and on page >> 155 it talks about exception handling. >> >> More specifically, it says that beginners usually make the mistake of >> putting File.open in the begin end block. >> >> Now, I am a ruby newbie but, how do you handle exceptions for File.open >> if it is not in the begin block? Do I put File.open in its own begin >> block? > > Does this help? > > http://blog.rubybestpractices.com/posts/rklemme/001-Using_blocks_for_Robustness.html > > Kind regards > > robert Yes - thanks that does help. But, I have to be honest it seems a bit strange to not have to use exception handling. Especially, when coming from the Java way of doing things. -- Posted via http://www.ruby-forum.com/.