Timeout::TimeoutError does not exist, use Timeout::Error instead
Also added a require for 'timeout' that contains this code. Easy to get confused as there is an alias TimeoutError: irb(main):001:0> require 'timeout' => true irb(main):002:0> TimeoutError => Timeout::Error irb(main):003:0> Timeout::Error => Timeout::Error irb(main):004:0> Timeout::TimeoutError NameError: uninitialized constant Timeout::TimeoutError from (irb):4
This commit is contained in:
parent
9a89db44f1
commit
3e2b3ece46
|
@ -1,5 +1,6 @@
|
||||||
require File.join(File.dirname(__FILE__), 'support', 'class')
|
require File.join(File.dirname(__FILE__), 'support', 'class')
|
||||||
require File.join(File.dirname(__FILE__), 'support', 'blank')
|
require File.join(File.dirname(__FILE__), 'support', 'blank')
|
||||||
|
require 'timeout'
|
||||||
|
|
||||||
# This file must be loaded after the JSON gem and any other library that beats up the Time class.
|
# This file must be loaded after the JSON gem and any other library that beats up the Time class.
|
||||||
class Time
|
class Time
|
||||||
|
@ -38,7 +39,7 @@ if RUBY_VERSION.to_f < 1.9
|
||||||
if IO.select([@io], nil, nil, @read_timeout)
|
if IO.select([@io], nil, nil, @read_timeout)
|
||||||
retry
|
retry
|
||||||
else
|
else
|
||||||
raise Timeout::TimeoutError
|
raise Timeout::Error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue