Exception: Synthra::Errors::LatencyLimitError
- Inherits:
-
ResourceLimitError
- Object
- StandardError
- Error
- ResourceLimitError
- Synthra::Errors::LatencyLimitError
- Defined in:
- lib/synthra/errors.rb
Overview
Latency exceeds configured maximum
Raised when the @latency behavior specifies a delay that exceeds the configured max_latency_ms limit.
Constant Summary collapse
- ERROR_CODE =
"LATENCY_LIMIT_ERROR"
Instance Attribute Summary collapse
-
#max_allowed ⇒ Integer
readonly
The maximum allowed latency in milliseconds.
-
#requested ⇒ Integer
readonly
The requested latency in milliseconds.
Instance Method Summary collapse
-
#initialize(requested:, max_allowed:) ⇒ LatencyLimitError
constructor
Create a new LatencyLimitError.
Constructor Details
#initialize(requested:, max_allowed:) ⇒ LatencyLimitError
Create a new LatencyLimitError
848 849 850 851 852 853 854 855 |
# File 'lib/synthra/errors.rb', line 848 def initialize(requested:, max_allowed:) @requested = requested @max_allowed = max_allowed super( "Latency #{requested}ms exceeds maximum allowed #{max_allowed}ms. " \ "Configure via Synthra.configure { |c| c.limits.max_latency_ms = N }" ) end |
Instance Attribute Details
#max_allowed ⇒ Integer (readonly)
Returns the maximum allowed latency in milliseconds.
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 |
# File 'lib/synthra/errors.rb', line 837 class LatencyLimitError < ResourceLimitError ERROR_CODE = "LATENCY_LIMIT_ERROR" attr_reader :requested, :max_allowed # Create a new LatencyLimitError # # @param requested [Integer] the requested latency in milliseconds # @param max_allowed [Integer] the configured maximum latency # def initialize(requested:, max_allowed:) @requested = requested @max_allowed = max_allowed super( "Latency #{requested}ms exceeds maximum allowed #{max_allowed}ms. " \ "Configure via Synthra.configure { |c| c.limits.max_latency_ms = N }" ) end end |
#requested ⇒ Integer (readonly)
Returns the requested latency in milliseconds.
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 |
# File 'lib/synthra/errors.rb', line 837 class LatencyLimitError < ResourceLimitError ERROR_CODE = "LATENCY_LIMIT_ERROR" attr_reader :requested, :max_allowed # Create a new LatencyLimitError # # @param requested [Integer] the requested latency in milliseconds # @param max_allowed [Integer] the configured maximum latency # def initialize(requested:, max_allowed:) @requested = requested @max_allowed = max_allowed super( "Latency #{requested}ms exceeds maximum allowed #{max_allowed}ms. " \ "Configure via Synthra.configure { |c| c.limits.max_latency_ms = N }" ) end end |