Exception: Janeway::Error

Inherits:
StandardError
  • Object
show all
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

AST::Error, Lexer::Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, query = nil, location = nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • message (String)

    error message

  • query (String) (defaults to: nil)

    entire query string

  • location (Location) (defaults to: nil)

    location of error



20
21
22
23
24
# File 'lib/janeway/error.rb', line 20

def initialize(msg, query = nil, location = nil)
  super("Jsonpath query #{query} - #{msg}")
  @query = query
  @location = location
end

Instance Attribute Details

#locationLocation? (readonly)

Returns:



15
16
17
# File 'lib/janeway/error.rb', line 15

def location
  @location
end

#queryString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/janeway/error.rb', line 12

def query
  @query
end