Exception: Synthra::Errors::CyclicReferenceError
- Inherits:
-
GenerationError
- Object
- StandardError
- Error
- GenerationError
- Synthra::Errors::CyclicReferenceError
- Defined in:
- lib/synthra/errors.rb
Overview
Cyclic reference detected between schemas
Raised when schemas reference each other in a cycle, which would cause infinite recursion during generation.
Constant Summary collapse
- ERROR_CODE =
"CYCLIC_REFERENCE_ERROR"
Instance Attribute Summary collapse
-
#cycle ⇒ Array<String>
readonly
The schema names forming the cycle.
Instance Method Summary collapse
-
#initialize(cycle) ⇒ CyclicReferenceError
constructor
Create a new CyclicReferenceError.
Constructor Details
#initialize(cycle) ⇒ CyclicReferenceError
Create a new CyclicReferenceError
676 677 678 679 680 |
# File 'lib/synthra/errors.rb', line 676 def initialize(cycle) @cycle = cycle cycle_str = cycle.join(" -> ") super("Cyclic reference detected: #{cycle_str}") end |
Instance Attribute Details
#cycle ⇒ Array<String> (readonly)
Returns the schema names forming the cycle.
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
# File 'lib/synthra/errors.rb', line 666 class CyclicReferenceError < GenerationError ERROR_CODE = "CYCLIC_REFERENCE_ERROR" attr_reader :cycle # Create a new CyclicReferenceError # # @param cycle [Array<String>] the schema names in the reference cycle # def initialize(cycle) @cycle = cycle cycle_str = cycle.join(" -> ") super("Cyclic reference detected: #{cycle_str}") end end |