Module: Kobako::Diagnosable
- Included in:
- SandboxError, ServiceError
- Defined in:
- lib/kobako/errors.rb,
sig/kobako/errors.rbs
Overview
The structured attribution the two invocation-failure classes carry
from a decoded guest exception — its origin, original klass, and
backtrace_lines — so a Host App can inspect a failure beyond its
message. Mixed into both rather than promoted to a shared superclass
because SandboxError and ServiceError sit in distinct branches of
the invocation-outcome taxonomy under Kobako::Error.
Data specific to one kind of failure rides a named reader on the
subclass that failure raises, the way Ruby pairs NameError#name with
NameError#local_variables — see UndefinedEntrypointError.
Instance Attribute Summary collapse
-
#backtrace_lines ⇒ Array[String]?
readonly
Returns the value of attribute backtrace_lines.
-
#klass ⇒ String?
readonly
Returns the value of attribute klass.
-
#origin ⇒ String?
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
Instance Attribute Details
#backtrace_lines ⇒ Array[String]? (readonly)
Returns the value of attribute backtrace_lines.
98 99 100 |
# File 'lib/kobako/errors.rb', line 98 def backtrace_lines @backtrace_lines end |
#klass ⇒ String? (readonly)
Returns the value of attribute klass.
98 99 100 |
# File 'lib/kobako/errors.rb', line 98 def klass @klass end |
#origin ⇒ String? (readonly)
Returns the value of attribute origin.
98 99 100 |
# File 'lib/kobako/errors.rb', line 98 def origin @origin end |
Instance Method Details
#initialize(message, origin: nil, klass: nil, backtrace_lines: nil) ⇒ Object
100 101 102 103 104 105 |
# File 'lib/kobako/errors.rb', line 100 def initialize(, origin: nil, klass: nil, backtrace_lines: nil) super() @origin = origin @klass = klass @backtrace_lines = backtrace_lines end |