Project

General

Profile

Actions

Bug #2343

closed

Timeout.timeout doesn't raise Timeout::Error by default

Added by hongli (Hongli Lai) over 14 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Backport:
[ruby-core:26563]

Description

=begin
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]
    =end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0