Exception: Janeway::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Janeway::Error
show all
- Defined in:
- lib/janeway/error.rb
Overview
Base class for JSONPath query errors
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(message, query = nil, location = nil) ⇒ Error
Returns a new instance of Error.
17
18
19
20
21
|
# File 'lib/janeway/error.rb', line 17
def initialize(message, query = nil, location = nil)
super("Jsonpath query #{query} - #{message}")
@query = query
@location = location
end
|
Instance Attribute Details
12
13
14
|
# File 'lib/janeway/error.rb', line 12
def location
@location
end
|
#query ⇒ String
9
10
11
|
# File 'lib/janeway/error.rb', line 9
def query
@query
end
|
Instance Method Details
#detailed_message ⇒ Object
23
24
25
26
27
|
# File 'lib/janeway/error.rb', line 23
def detailed_message
msg = "Error: #{message}\nQuery: #{query}\n"
msg += (' ' * location.col) + '^' if @location
msg
end
|