Exception: Moxml::XPath::SyntaxError
- Inherits:
-
Error
- Object
- StandardError
- Error
- Moxml::XPathError
- Error
- Moxml::XPath::SyntaxError
- Defined in:
- lib/moxml/xpath/errors.rb
Overview
Error raised when XPath syntax is invalid
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Moxml::XPathError
Instance Method Summary collapse
-
#initialize(message, expression: nil, position: nil, token: nil) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, expression: nil, position: nil, token: nil) ⇒ SyntaxError
Returns a new instance of SyntaxError.
13 14 15 16 17 |
# File 'lib/moxml/xpath/errors.rb', line 13 def initialize(, expression: nil, position: nil, token: nil) @position = position @token = token super(, expression: expression) end |
Instance Attribute Details
#position ⇒ Object (readonly)
Returns the value of attribute position.
11 12 13 |
# File 'lib/moxml/xpath/errors.rb', line 11 def position @position end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
11 12 13 |
# File 'lib/moxml/xpath/errors.rb', line 11 def token @token end |
Instance Method Details
#to_s ⇒ Object
19 20 21 22 23 24 |
# File 'lib/moxml/xpath/errors.rb', line 19 def to_s msg = super msg += "\n Position: #{@position}" if @position msg += "\n Unexpected token: #{@token.inspect}" if @token msg end |