Exception: Janeway::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Janeway::Error
- Defined in:
- lib/janeway/error.rb
Overview
Error class for Janeway. Contains a copy of the jsonpath query string. Lexer errors may also include the index into the query string that points at which token was being lexed at the time of the error.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#location ⇒ Location?
readonly
For lexer errors, this is the index on the query string where the error was encountered.
-
#query ⇒ String
readonly
JSONPath query.
Instance Method Summary collapse
-
#initialize(msg, query = nil, location = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, query = nil, location = nil) ⇒ Error
Returns a new instance of Error.
22 23 24 25 26 |
# File 'lib/janeway/error.rb', line 22 def initialize(msg, query = nil, location = nil) super("Jsonpath query #{query} - #{msg}") @query = query @location = location end |
Instance Attribute Details
#location ⇒ Location? (readonly)
For lexer errors, this is the index on the query string where the error was encountered
17 18 19 |
# File 'lib/janeway/error.rb', line 17 def location @location end |
#query ⇒ String (readonly)
JSONPath query
13 14 15 |
# File 'lib/janeway/error.rb', line 13 def query @query end |