Exception: Synthra::Errors::RecursionLimitError
- Inherits:
-
ResourceLimitError
- Object
- StandardError
- Error
- ResourceLimitError
- Synthra::Errors::RecursionLimitError
- Defined in:
- lib/synthra/errors.rb
Overview
Recursion depth exceeds configured maximum
Raised when nested schema generation exceeds the maximum recursion depth, which could indicate a circular reference or overly deep nesting.
Constant Summary collapse
- ERROR_CODE =
"RECURSION_LIMIT_ERROR"
Instance Attribute Summary collapse
-
#depth ⇒ Integer
readonly
The current recursion depth.
-
#max_allowed ⇒ Integer
readonly
The maximum allowed recursion depth.
Instance Method Summary collapse
-
#initialize(depth:, max_allowed:) ⇒ RecursionLimitError
constructor
Create a new RecursionLimitError.
Constructor Details
#initialize(depth:, max_allowed:) ⇒ RecursionLimitError
Create a new RecursionLimitError
886 887 888 889 890 891 892 893 |
# File 'lib/synthra/errors.rb', line 886 def initialize(depth:, max_allowed:) @depth = depth @max_allowed = max_allowed super( "Recursion depth #{depth} exceeds maximum allowed #{max_allowed}. " \ "Configure via Synthra.configure { |c| c.limits.max_recursion = N }" ) end |
Instance Attribute Details
#depth ⇒ Integer (readonly)
Returns the current recursion depth.
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 |
# File 'lib/synthra/errors.rb', line 875 class RecursionLimitError < ResourceLimitError ERROR_CODE = "RECURSION_LIMIT_ERROR" attr_reader :depth, :max_allowed # Create a new RecursionLimitError # # @param depth [Integer] the current recursion depth # @param max_allowed [Integer] the configured maximum depth # def initialize(depth:, max_allowed:) @depth = depth @max_allowed = max_allowed super( "Recursion depth #{depth} exceeds maximum allowed #{max_allowed}. " \ "Configure via Synthra.configure { |c| c.limits.max_recursion = N }" ) end end |
#max_allowed ⇒ Integer (readonly)
Returns the maximum allowed recursion depth.
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 |
# File 'lib/synthra/errors.rb', line 875 class RecursionLimitError < ResourceLimitError ERROR_CODE = "RECURSION_LIMIT_ERROR" attr_reader :depth, :max_allowed # Create a new RecursionLimitError # # @param depth [Integer] the current recursion depth # @param max_allowed [Integer] the configured maximum depth # def initialize(depth:, max_allowed:) @depth = depth @max_allowed = max_allowed super( "Recursion depth #{depth} exceeds maximum allowed #{max_allowed}. " \ "Configure via Synthra.configure { |c| c.limits.max_recursion = N }" ) end end |