From: Joel VanderWerf Date: 2008-02-08T04:50:02+09:00 Subject: Re: Timeout::Error Nobuyoshi Nakada wrote: > Hi, > > At Thu, 7 Feb 2008 17:28:05 +0900, > Jeremy Thurgood wrote in [ruby-core:15413]: >>>> What was the change? I currently lack the time and resources to go >>>> digging through commit logs for it. >>> TimeoutError was a subclass of StandardError till 1.6, but now >>> it inherits Interrupt which is not a subclass of StandardError. >> Any idea why this changed? > > Sorry, I can't remember it correctly now. Perhaps, not to > happen to be caught accidentally. That sounds like a good reason: require 'timeout' a = nil begin Timeout.timeout 0.5, StandardError do a = (0..2).map do |i| (sleep(0.3); i.to_i) rescue i.to_s end end rescue TimeoutError => ex p ex end p a # [0, "1", 2] a = nil begin Timeout.timeout 0.5 do a = (0..2).map do |i| (sleep(0.3); i.to_i) rescue i.to_s end end rescue TimeoutError => ex p ex # end p a # nil -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407