From: Sean O'Dell Date: 2002-02-27T07:05:14+09:00 Subject: Re: Rescue Clause "Joel VanderWerf" wrote in message > Tobias Reif wrote: > > > > I think I might like to be able to use it with open: > > > > open('foozboo.zer', 'r') do |file| > > rescue > > end > > > Which exceptions would it catch? Ones from the open(), or ones from > inside do...rescue ? The former doesn't seem likely. Just the exceptions inside the block, after the open call. It's fairly typical to want to catch exceptions after a certain call to handle errors there, but to have that same call wrapped by a different handler. To me, this makes sense and is more elegant: def func open do open call worked, do stuff rescue something failed end rescue open call failed, deal with it end ....as opposed to the more verbose: def func begin open do begin open call worked, do stuff rescue something failed end end rescue open call failed end end Sean