From: Hongli Lai Date: 2009-11-06T21:00:28+09:00 Subject: [ruby-core:26563] [Bug #2343] Timeout.timeout doesn't raise Timeout::Error by default Bug #2343: Timeout.timeout doesn't raise Timeout::Error by default http://redmine.ruby-lang.org/issues/show/2343 Author: Hongli Lai Status: Open, Priority: Normal ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] Timeout.timeout's documentation says that it'll raise Timeout::Error by default, but the code actually raises an object whose class is an anonymous subclass of Timeout::ExitException: def timeout(sec, klass = nil) ... exception = klass || Class.new(ExitException) This is not only inconsistent with the documentation, but also breaks many applications which assume that Timeout::Error is the default. So which one is wrong? The code or the documentation? If the documentation is wrong then what was the reason for the change? This issue applies to both of these Ruby versions: - ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] - ruby 1.9.2dev (2009-08-05 trunk 24397) [i386-darwin9.6.0] ---------------------------------------- http://redmine.ruby-lang.org