Exception: Ibex::Runtime::ResourceLimitError
- Inherits:
-
ParseError
- Object
- StandardError
- ParseError
- Ibex::Runtime::ResourceLimitError
- Defined in:
- lib/ibex/runtime/parser.rb
Overview
Raised when a configured parser-session resource budget is exhausted.
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
: Integer.
-
#observed ⇒ Object
readonly
: Integer.
-
#resource ⇒ Object
readonly
: Symbol.
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 ⇒ Object
Methods inherited from ParseError
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 ⇒ Object (readonly)
: Integer
88 89 90 |
# File 'lib/ibex/runtime/parser.rb', line 88 def limit @limit end |
#observed ⇒ Object (readonly)
: Integer
89 90 91 |
# File 'lib/ibex/runtime/parser.rb', line 89 def observed @observed end |
#resource ⇒ Object (readonly)
: Symbol
87 88 89 |
# File 'lib/ibex/runtime/parser.rb', line 87 def resource @resource end |
Instance Method Details
#to_h ⇒ Object
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 |