From: Stefano Crocco Date: 2008-09-18T23:07:37+09:00 Subject: Re: why does this prog still stop after exception Alle Thursday 18 September 2008, Junkone ha scritto: > i thought i put enough exception handlers for the prog to continue > after failure. why does it stop > require 'imDaveAlerts' > require "timeoutx" > > while(true) > puts Time.now > begin > TimeoutX.timeout(15){ > begin > a=DaveAlerts.new > a.doAlerts() > rescue => detail > print detail.backtrace.join("\n") > end > } > rescue => detail > print detail.backtrace.join("\n") > end > sleep(5) > end > > Wc:/ruby/lib/ruby/gems/1.8/gems/timeoutx-0.3.0/lib/timeoutx.rb:40:in > `wait': execution expired (TimeoutX::Error) If no exception class is specified, rescue only rescues exceptions derived from StandardError, which TimeoutX::Error is not. If you want to rescue all exceptions, you need to explicitly write rescue Exception I hope this helps Stefano