Exception: Synthra::Errors::ArraySizeLimitError
- Inherits:
-
ResourceLimitError
- Object
- StandardError
- Error
- ResourceLimitError
- Synthra::Errors::ArraySizeLimitError
- Defined in:
- lib/synthra/errors.rb
Overview
Array size exceeds configured maximum
Raised when generating an array with more elements than the configured max_array_size limit.
Constant Summary collapse
- ERROR_CODE =
"ARRAY_SIZE_LIMIT_ERROR"
Instance Attribute Summary collapse
-
#max_allowed ⇒ Integer
readonly
The maximum allowed array size.
-
#size ⇒ Integer
readonly
The requested array size.
Instance Method Summary collapse
-
#initialize(size:, max_allowed:) ⇒ ArraySizeLimitError
constructor
Create a new ArraySizeLimitError.
Constructor Details
#initialize(size:, max_allowed:) ⇒ ArraySizeLimitError
Create a new ArraySizeLimitError
924 925 926 927 928 929 930 931 |
# File 'lib/synthra/errors.rb', line 924 def initialize(size:, max_allowed:) @size = size @max_allowed = max_allowed super( "Array size #{size} exceeds maximum allowed #{max_allowed}. " \ "Configure via Synthra.configure { |c| c.limits.max_array_size = N }" ) end |
Instance Attribute Details
#max_allowed ⇒ Integer (readonly)
Returns the maximum allowed array size.
913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/synthra/errors.rb', line 913 class ArraySizeLimitError < ResourceLimitError ERROR_CODE = "ARRAY_SIZE_LIMIT_ERROR" attr_reader :size, :max_allowed # Create a new ArraySizeLimitError # # @param size [Integer] the requested array size # @param max_allowed [Integer] the configured maximum size # def initialize(size:, max_allowed:) @size = size @max_allowed = max_allowed super( "Array size #{size} exceeds maximum allowed #{max_allowed}. " \ "Configure via Synthra.configure { |c| c.limits.max_array_size = N }" ) end end |
#size ⇒ Integer (readonly)
Returns the requested array size.
913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/synthra/errors.rb', line 913 class ArraySizeLimitError < ResourceLimitError ERROR_CODE = "ARRAY_SIZE_LIMIT_ERROR" attr_reader :size, :max_allowed # Create a new ArraySizeLimitError # # @param size [Integer] the requested array size # @param max_allowed [Integer] the configured maximum size # def initialize(size:, max_allowed:) @size = size @max_allowed = max_allowed super( "Array size #{size} exceeds maximum allowed #{max_allowed}. " \ "Configure via Synthra.configure { |c| c.limits.max_array_size = N }" ) end end |