Exception: Flexr::Runtime::ResourceLimitError
- Defined in:
- lib/flexr/runtime/errors.rb
Direct Known Subclasses
BufferTooLargeError, CancelledError, InvalidRecoveryActionError, LookaheadTooLargeError, NonProgressError, StateStackOverflowError, StepLimitError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Attributes inherited from LexError
#byte_pos, #filename, #line, #text
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(code, message, help:, filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) ⇒ ResourceLimitError
constructor
A new instance of ResourceLimitError.
Constructor Details
#initialize(code, message, help:, filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) ⇒ ResourceLimitError
Returns a new instance of ResourceLimitError.
27 28 29 30 31 32 |
# File 'lib/flexr/runtime/errors.rb', line 27 def initialize(code, , help:, filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) @code = code @rule = rule diagnostic = Diagnostics.error(code, , help: help, note: rule.nil? ? nil : "rule #{rule}") super(, filename: filename, byte_pos: byte_pos, line: line, text: text, diagnostic: diagnostic) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
25 26 27 |
# File 'lib/flexr/runtime/errors.rb', line 25 def code @code end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
25 26 27 |
# File 'lib/flexr/runtime/errors.rb', line 25 def rule @rule end |