From: Sandro Paganotti Date: 2008-10-11T00:03:18+09:00 Subject: Re: rescue clause ------=_Part_126104_6292594.1223651140991 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline The difference seems to be in that ' OptionParser::InvalidOption ' token but it's the first time I saw a begin-rescue block of this kind. On Fri, Oct 10, 2008 at 1:50 PM, Patrick Doyle wrote: > I have been looking at the source code for rake (as you can probably tell > from my previous questions), in an attempt to study a reasonable sized Ruby > application and see what I can learn from the exercise. I've come across > something that looks like it could be an innocuous typo in the code, or it > could be doing something that I just don't understand. Here is the code > snippet: > > def standard_exception_handling > begin > yield > rescue SystemExit => ex > # Exit silently with current status > exit(ex.status) > rescue SystemExit, OptionParser::InvalidOption => ex > # Exit silently > exit(1) > end > end > > I am curious as to why SystemExit shows up in 2 different rescue clauses. > Is that a typo? Or is something else going on? > > --wpd > -- Go outside! The graphics are amazing! ------=_Part_126104_6292594.1223651140991--