# File ruby-3.1.2/lib/timeout.rb, line 32defself.catch(*args)
exc = new(*args)
exc.instance_variable_set(:@thread, Thread.current)
exc.instance_variable_set(:@catch_value, exc)
::Kernel.catch(exc) {yieldexc}
end
Public Instance Methods
exception(*)click to toggle source
# File ruby-3.1.2/lib/timeout.rb, line 39defexception(*)
# TODO: use Fiber.current to see if self can be thrownifself.thread==Thread.currentbt = callerbeginthrow(@catch_value, bt)
rescueUncaughtThrowErrorendendsuperend