Exception: FiberStream::RactorPortSourceError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- FiberStream::RactorPortSourceError
- Defined in:
- lib/fiber_stream/errors.rb,
sig/fiber_stream.rbs
Overview
Normalized failure raised by Source.ractor_port.
Producer failures, invalid protocol messages, and source-side Ractor port
failures use this stable error shape so callers do not need to depend on
Ruby's Ractor transport exceptions. For producer failures,
cause_class_name and cause_message come from the producer's
RactorPort::Failure envelope and are included in this error's public
message.
Instance Attribute Summary collapse
-
#cause_class_name ⇒ String
readonly
Returns the value of attribute cause_class_name.
-
#cause_message ⇒ String
readonly
Returns the value of attribute cause_message.
-
#kind ⇒ ractor_port_source_error_kind
readonly
Returns the value of attribute kind.
-
#original_cause ⇒ Object
readonly
Returns the value of attribute original_cause.
Instance Method Summary collapse
-
#initialize(kind:, cause_class_name:, cause_message:, cause: nil) ⇒ RactorPortSourceError
constructor
A new instance of RactorPortSourceError.
Constructor Details
#initialize(kind:, cause_class_name:, cause_message:, cause: nil) ⇒ RactorPortSourceError
Returns a new instance of RactorPortSourceError.
19 20 21 22 23 24 25 26 |
# File 'lib/fiber_stream/errors.rb', line 19 def initialize(kind:, cause_class_name:, cause_message:, cause: nil) @kind = kind @cause_class_name = cause_class_name @cause_message = @original_cause = cause super("ractor_port #{kind} failure: #{cause_class_name}: #{}") end |
Instance Attribute Details
#cause_class_name ⇒ String (readonly)
Returns the value of attribute cause_class_name.
17 18 19 |
# File 'lib/fiber_stream/errors.rb', line 17 def cause_class_name @cause_class_name end |
#cause_message ⇒ String (readonly)
Returns the value of attribute cause_message.
17 18 19 |
# File 'lib/fiber_stream/errors.rb', line 17 def @cause_message end |
#kind ⇒ ractor_port_source_error_kind (readonly)
Returns the value of attribute kind.
17 18 19 |
# File 'lib/fiber_stream/errors.rb', line 17 def kind @kind end |
#original_cause ⇒ Object (readonly)
Returns the value of attribute original_cause.
17 18 19 |
# File 'lib/fiber_stream/errors.rb', line 17 def original_cause @original_cause end |