From: Stefan Rusterholz Date: 2007-07-20T08:34:16+09:00 Subject: Re: RCR? Added syntax for chains that possibly return nil Trans wrote: > On Jul 19, 3:33 pm, Stefan Rusterholz wrote: >> Trans wrote: >> > what about >> > foo = bar.baz.quuz rescue default >> >> See the answer to gabriele renzi (Simple: what if your exception is not >> the NoMethodError you are worried >> about? You'll never know.) > > I think it rescues all StandardErrors. > > T. Um, Yes, that's exactly the problem about it, wasn't that clear? It rescues *all* StandardErrors. So you won't notice if something else than your NoMethodError - which nil would raise - has happened. Say your gets raises a BrokenPipe exception or similar since the server you were connected disconnects you because of bad input you send. Your will never see an exception being raised since that happens in the gets you just rescue all standarderrors from. Regards Stefan -- Posted via http://www.ruby-forum.com/.