Exception: Ibex::Runtime::ResourceLimitError

Inherits:
ParseError
  • Object
show all
Defined in:
lib/json5/generated_parser.rb

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.

RBS:

  • (resource: Symbol, limit: Integer, observed: Integer, state: Integer?, location: runtime_value) -> void



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

#limitObject (readonly)

Signature:

  • Integer



5762
5763
5764
# File 'lib/json5/generated_parser.rb', line 5762

def limit
  @limit
end

#observedObject (readonly)

Signature:

  • Integer



5763
5764
5765
# File 'lib/json5/generated_parser.rb', line 5763

def observed
  @observed
end

#resourceObject (readonly)

Signature:

  • Symbol



5761
5762
5763
# File 'lib/json5/generated_parser.rb', line 5761

def resource
  @resource
end

Instance Method Details

#to_hObject

RBS:

  • () -> Hash[Symbol, runtime_value]



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