类 Ractor::RemoteError
当尝试对 Ractor#take
进行操作时,如果 Ractor
中存在未捕获的异常,则会引发此异常。它的 cause
将包含原始异常,而 ractor
是引发异常的原始 Ractor。
r = Ractor.new { raise "Something weird happened" } begin r.take rescue => e p e # => #<Ractor::RemoteError: thrown by remote Ractor.> p e.ractor == r # => true p e.cause # => #<RuntimeError: Something weird happened> end
属性
ractor[R]
引发未捕获异常的 Ractor
。