Exception: Ibex::Runtime::ResourceLimitError
Overview
Raised when a configured parser-session resource budget is exhausted.
Instance Attribute Summary collapse
Attributes inherited from ParseError
#error_id, #expected_tokens, #location, #state, #suggestions, #token_id, #token_name, #token_value
Instance Method Summary
collapse
Methods inherited from ParseError
#location_label
Constructor Details
#initialize(resource:, limit:, observed:, state:, location:) ⇒ ResourceLimitError
Returns a new instance of ResourceLimitError.
5766
5767
5768
5769
5770
5771
5772
5773
5774
|
# File 'lib/json5/generated_parser.rb', line 5766
def initialize(resource:, limit:, observed:, state:, location:)
@resource = resource
@limit = limit
@observed = observed
super(
"parser resource limit exceeded: #{resource} is #{observed}, configured maximum is #{limit}",
state: state, location: location
)
end
|
Instance Attribute Details
#limit ⇒ Object
5762
5763
5764
|
# File 'lib/json5/generated_parser.rb', line 5762
def limit
@limit
end
|
#observed ⇒ Object
5763
5764
5765
|
# File 'lib/json5/generated_parser.rb', line 5763
def observed
@observed
end
|
#resource ⇒ Object
5761
5762
5763
|
# File 'lib/json5/generated_parser.rb', line 5761
def resource
@resource
end
|
Instance Method Details
#to_h ⇒ Object
5777
5778
5779
5780
5781
5782
|
# File 'lib/json5/generated_parser.rb', line 5777
def to_h
{
type: :resource_limit, resource: @resource, limit: @limit, observed: @observed,
state: state, location: location
}.freeze
end
|