Exception: Kobako::Transport::Error
- Inherits:
-
SandboxError
- Object
- StandardError
- Error
- SandboxError
- Kobako::Transport::Error
- Defined in:
- lib/kobako/transport/error.rb,
sig/kobako/transport/error.rbs
Overview
Kobako::SandboxError subclass raised when the host detects a
structural violation of the wire contract while reading what the
guest produced — an invocation value the payload codec cannot
decode. Distinct from a Wasm trap (engine signalled the guest
runtime is unrecoverable) and from a normal sandbox-layer failure
(the script raised but the protocol was respected): a
Transport::Error always indicates the guest runtime is corrupted —
the only safe recovery is to discard the Sandbox and start a new
invocation.
Inherits from Kobako::SandboxError so a single
rescue Kobako::SandboxError still catches it; callers that want
to distinguish wire-violation paths from script failures can
rescue Kobako::Transport::Error directly.
Instance Attribute Summary
Attributes included from CarriesExecution
Attributes included from Diagnosable
#backtrace_lines, #klass, #origin
Instance Method Summary collapse
-
#detailed_message ⇒ String
The codec fault behind this violation, appended to Ruby's own rendering.
-
#initialize(message, diagnostic: nil) ⇒ Error
constructor
A new instance of Error.
Methods included from CarriesExecution
Constructor Details
#initialize(message, diagnostic: nil) ⇒ Error
Returns a new instance of Error.
22 23 24 25 |
# File 'lib/kobako/transport/error.rb', line 22 def initialize(, diagnostic: nil, **) super(, **) @diagnostic = diagnostic end |
Instance Method Details
#detailed_message ⇒ String
The codec fault behind this violation, appended to Ruby's own
rendering. A caller cannot act on the inner "Symbol payload must
be …" wording, so it stays out of #message; an operator
triaging a corrupted runtime still needs it, and
detailed_message is where Ruby puts text of exactly that kind.
32 33 34 35 36 37 |
# File 'lib/kobako/transport/error.rb', line 32 def (...) rendered = super return rendered if @diagnostic.nil? "#{rendered}\n#{@diagnostic}" end |