类 Ractor::RemoteError

如果在 Ractor 中存在未捕获的异常,则在尝试 Ractor#take 时会引发此异常。它的 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]