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:
Seth Falcon 2009-06-12 14:06:07 -07:00 committed by Matt Aimonetti
parent 9a89db44f1
commit 3e2b3ece46

View file

@ -1,5 +1,6 @@
require File.join(File.dirname(__FILE__), 'support', 'class')
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.
class Time
@ -38,7 +39,7 @@ if RUBY_VERSION.to_f < 1.9
if IO.select([@io], nil, nil, @read_timeout)
retry
else
raise Timeout::TimeoutError
raise Timeout::Error
end
end
else