class Timeout::Error
- Parent:
- RuntimeError
def self.catch(*args)
exc = new(*args)
exc.instance_variable_set(:@thread, Thread.current)
::Kernel.catch(exc) {yield exc}
end
def exception(*)
if self.thread == Thread.current
bt = caller
begin
throw(self, bt)
rescue UncaughtThrowError
end
end
self
end
Ruby Core © 1993–2020 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.