Exception: Ibex::Runtime::ResourceLimitError
- Inherits:
-
ParseError
- Object
- StandardError
- ParseError
- Ibex::Runtime::ResourceLimitError
- Defined in:
- lib/ibex/runtime/parser.rb,
sig/ibex/runtime/parser.rbs
Overview
Raised when a configured parser-session resource budget is exhausted.
Instance Attribute Summary collapse
- #limit ⇒ Integer readonly
- #observed ⇒ Integer readonly
- #resource ⇒ Symbol readonly
Attributes inherited from ParseError
#error_id, #expected_tokens, #location, #state, #suggestions, #token_id, #token_name, #token_value
Instance Method Summary collapse
-
#initialize(resource:, limit:, observed:, state:, location:) ⇒ ResourceLimitError
constructor
A new instance of ResourceLimitError.
- #to_h ⇒ Hash[Symbol, untyped]
Methods inherited from ParseError
#diagnostic_message, #location_label, #location_value
Constructor Details
#initialize(resource:, limit:, observed:, state:, location:) ⇒ ResourceLimitError
Returns a new instance of ResourceLimitError.
92 93 94 95 96 97 98 99 100 |
# File 'lib/ibex/runtime/parser.rb', line 92 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 ⇒ Integer (readonly)
88 89 90 |
# File 'lib/ibex/runtime/parser.rb', line 88 def limit @limit end |
#observed ⇒ Integer (readonly)
89 90 91 |
# File 'lib/ibex/runtime/parser.rb', line 89 def observed @observed end |
#resource ⇒ Symbol (readonly)
87 88 89 |
# File 'lib/ibex/runtime/parser.rb', line 87 def resource @resource end |
Instance Method Details
#to_h ⇒ Hash[Symbol, untyped]
103 104 105 106 107 108 |
# File 'lib/ibex/runtime/parser.rb', line 103 def to_h { type: :resource_limit, resource: @resource, limit: @limit, observed: @observed, state: state, location: location }.freeze end |