Exception: Kumi::Parser::Errors::ParseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/kumi/parser/errors.rb

Overview

Custom error for parsing issues

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, token:, suggestions: []) ⇒ ParseError

Returns a new instance of ParseError.



9
10
11
12
13
# File 'lib/kumi/parser/errors.rb', line 9

def initialize(message, token:, suggestions: [])
  @token = token
  @suggestions = suggestions
  super(build_error_message(message))
end

Instance Attribute Details

#suggestionsObject (readonly)

Returns the value of attribute suggestions.



7
8
9
# File 'lib/kumi/parser/errors.rb', line 7

def suggestions
  @suggestions
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/kumi/parser/errors.rb', line 7

def token
  @token
end