Exception: Timeout::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/timeout.rb

Overview

Raised by Timeout.timeout when the block times out.

Class Method Summary collapse

Class Method Details

.handle_timeout(message) ⇒ Object

:nodoc:



38
39
40
41
42
43
44
45
46
47
# File 'lib/timeout.rb', line 38

def self.handle_timeout(message) # :nodoc:
  exc = ExitException.new(message)

  begin
    yield exc
  rescue ExitException => e
    raise new(message) if exc.equal?(e)
    raise
  end
end