From: dblack@... Date: 2006-12-11T22:26:14+09:00 Subject: Re: else inside rescue is useless? Hi -- On Mon, 11 Dec 2006, Anthony Gardner wrote: > exactly, the else is in the rescue which means an exception has been > thrown. if it doesn;t match any of the exceptions you've declared as > being important to catching, and you include an else, the else wiill > catch what you don;t want. > > no?! No; I think what you need is just a blank 'rescue', not else: begin puts "do something" raise ZeroDivisionError rescue NameError puts "name error #{$!}" rescue puts "else #{$!}" end Output: do something else ZeroDivisionError An else clause will run if there's no exception at all. I don't have my Ruby Way on me but if it says else I think it should say rescue. David -- Q. What's a good holiday present for the serious Rails developer? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) aka The Ruby book for Rails developers! Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)