Project

General

Profile

Actions

Bug #9354

closed

timeout() custom exception class cannot require argument

Added by tmm1 (Aman Karmani) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Target version:
[ruby-core:59511]

Description

The following code works on 2.0.0, but raises on 2.1.0:

require 'timeout'
class MyError < StandardError
def initialize(msg)
super
end
end
timeout(1, MyError){}

$ ruby -v
ruby 2.1.0p0-github (2013-12-31 revision 44488) [x86_64-darwin13.0]
$ ruby /tmp/test.rb
/tmp/test.rb:4:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)

The patch attached resolves this issue.


Files

timeout_klass_arg.patch (795 Bytes) timeout_klass_arg.patch tmm1 (Aman Karmani), 01/03/2014 07:09 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0