Class: Kobako::Wire::Envelope::Panic
- Inherits:
-
Data
- Object
- Data
- Kobako::Wire::Envelope::Panic
- Defined in:
- lib/kobako/wire/envelope/payloads.rb
Overview
Panic (SPEC.md Outcome Envelope → Panic)
Failure Outcome payload. Encoded as a msgpack map keyed by name (forward-compatibility — unknown keys are silently ignored). Required: “origin” / “class” / “message”. Optional: “backtrace” (array of str), “details” (any wire-legal value).
Constant Summary collapse
- ORIGIN_SANDBOX =
"sandbox"- ORIGIN_SERVICE =
"service"
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
-
#initialize(origin:, klass:, message:, backtrace: [], details: nil) ⇒ Panic
constructor
A new instance of Panic.
Constructor Details
#initialize(origin:, klass:, message:, backtrace: [], details: nil) ⇒ Panic
Returns a new instance of Panic.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/kobako/wire/envelope/payloads.rb', line 44 def initialize(origin:, klass:, message:, backtrace: [], details: nil) raise ArgumentError, "Panic origin must be String" unless origin.is_a?(String) raise ArgumentError, "Panic class must be String" unless klass.is_a?(String) raise ArgumentError, "Panic message must be String" unless .is_a?(String) unless backtrace.is_a?(Array) && backtrace.all?(String) raise ArgumentError, "Panic backtrace must be Array of String" end super end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace
43 44 45 |
# File 'lib/kobako/wire/envelope/payloads.rb', line 43 def backtrace @backtrace end |
#details ⇒ Object (readonly)
Returns the value of attribute details
43 44 45 |
# File 'lib/kobako/wire/envelope/payloads.rb', line 43 def details @details end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass
43 44 45 |
# File 'lib/kobako/wire/envelope/payloads.rb', line 43 def klass @klass end |
#message ⇒ Object (readonly)
Returns the value of attribute message
43 44 45 |
# File 'lib/kobako/wire/envelope/payloads.rb', line 43 def @message end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin
43 44 45 |
# File 'lib/kobako/wire/envelope/payloads.rb', line 43 def origin @origin end |