A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.ruby-lang.org/en/3.0/Timeout/Error.html below:

class Timeout::Error - RDoc Documentation

class Timeout::Error

Raised by Timeout.timeout when the block times out.

Attributes Public Class Methods

catch(*args) { |exc| ... } click to toggle source

# File lib/timeout.rb, line 32
def self.catch(*args)
  exc = new(*args)
  exc.instance_variable_set(:@thread, Thread.current)
  ::Kernel.catch(exc) {yield exc}
end
Public Instance Methods

exception(*) click to toggle source

# File lib/timeout.rb, line 38
def exception(*)
  # TODO: use Fiber.current to see if self can be thrown
  if self.thread == Thread.current
    bt = caller
    begin
      throw(self, bt)
    rescue UncaughtThrowError
    end
  end
  self
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4