Exception: Gaskit::OperationExit
- Defined in:
- lib/gaskit/operation_exit.rb
Overview
OperationExit is a custom exception representing an early exit from an operation.
It communicates intent-based flow interruption (e.g., authorization failure, validation issue) and includes a symbolic ‘key`, optional `message`, and optional `code`.
Instance Attribute Summary collapse
-
#code ⇒ String?
readonly
Optional structured code (e.g., “AUTH-001”).
-
#key ⇒ Symbol, String
readonly
The symbolic or textual reason for the early exit.
Instance Method Summary collapse
-
#initialize(key, message = nil, code: nil) ⇒ OperationExit
constructor
Initializes an OperationExit.
- #inspect ⇒ Object
Constructor Details
#initialize(key, message = nil, code: nil) ⇒ OperationExit
Initializes an OperationExit.
33 34 35 36 37 |
# File 'lib/gaskit/operation_exit.rb', line 33 def initialize(key, = nil, code: nil) super( || "early exit") @key = key @code = code end |
Instance Attribute Details
#code ⇒ String? (readonly)
Returns Optional structured code (e.g., “AUTH-001”).
26 27 28 |
# File 'lib/gaskit/operation_exit.rb', line 26 def code @code end |
#key ⇒ Symbol, String (readonly)
Returns The symbolic or textual reason for the early exit.
23 24 25 |
# File 'lib/gaskit/operation_exit.rb', line 23 def key @key end |
Instance Method Details
#inspect ⇒ Object
39 40 41 |
# File 'lib/gaskit/operation_exit.rb', line 39 def inspect "#<#{self.class} key=#{key.inspect} message=#{message.inspect} code=#{code.inspect}>" end |