Exception: Synthra::Errors::CycleError
- Inherits:
-
ParseError
- Object
- StandardError
- Error
- ParseError
- Synthra::Errors::CycleError
- Defined in:
- lib/synthra/errors.rb
Overview
Circular schema reference detected
Raised when schemas reference each other in a cycle that would cause infinite recursion during data generation.
Constant Summary collapse
- ERROR_CODE =
"CYCLE_ERROR"
Instance Attribute Summary collapse
-
#cycle ⇒ Array<String>
readonly
The schemas involved in the cycle.
Instance Method Summary collapse
-
#initialize(cycle, **kwargs) ⇒ CycleError
constructor
Create a new CycleError.
Constructor Details
#initialize(cycle, **kwargs) ⇒ CycleError
Create a new CycleError
335 336 337 338 339 |
# File 'lib/synthra/errors.rb', line 335 def initialize(cycle, **kwargs) @cycle = cycle cycle_path = cycle.join(" -> ") super("Circular schema reference detected: #{cycle_path}", **kwargs) end |
Instance Attribute Details
#cycle ⇒ Array<String> (readonly)
Returns the schemas involved in the cycle.
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/synthra/errors.rb', line 324 class CycleError < ParseError ERROR_CODE = "CYCLE_ERROR" attr_reader :cycle # Create a new CycleError # # @param cycle [Array<String>] list of schema names in the cycle # @param kwargs [Hash] additional options # def initialize(cycle, **kwargs) @cycle = cycle cycle_path = cycle.join(" -> ") super("Circular schema reference detected: #{cycle_path}", **kwargs) end end |