timeout() custom exception class cannot require argument
|Target version:||next minor|
|ruby -v:||trunk||Backport:||1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: DONE|
The following code works on 2.0.0, but raises on 2.1.0:
class MyError < StandardError
$ 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.
#2 Updated by Nobuyoshi Nakada 4 months ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r44517.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
timeout.rb: defer creating custom exception
- lib/timeout.rb (Timeout#timeout): when a custom exception is given, no instance is needed to be caught, so defer creating new instance until it is raised. [Bug #9354]
#3 Updated by Aman Gupta 4 months ago
- Assignee set to Yui NARUSE
- Target version set to next minor
- % Done changed from 100 to 0
- Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: REQUIRED
Thanks @nobu. This is causing some failures in the faraday gem, so I think we should backport it to 2.1
#4 Updated by Nobuyoshi Nakada 4 months ago
- Status changed from Closed to Open
- Assignee deleted (
- Target version deleted (
- Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: REQUIRED to 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: REQUIRED
Timeout in 2.0 doesn't use catch/throw, so it doesn't need to backport.