--000e0cd1511c514256046f8bb17b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The usual way, >> begin ?> File.open("fjaskfajs") # Or, whatever code you have on line 3 of yaml_prac.rb >> rescue Errno::ENOENT >> p "file not found" >> end "file not found" nil Ray On Sat, Jul 25, 2009 at 10:37 AM, Venkat Akkineni < venkatram.akkineni / gmail.com> wrote: > Thanks for the reply Ray > > I purposefully did not create the file to see what error will > be raised. I am sorry I failed to mention that. I am trying to ensure > that this error will not be thrown to the user when a file is not found. > Hence I want to handle it with rescue. How can I achieve this. > > Thanks > Venkat > -- > Posted via http://www.ruby-forum.com/. > > --000e0cd1511c514256046f8bb17b--