Exception: Janeway::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Janeway::Error
- Defined in:
- lib/janeway/error.rb
Overview
Base class for JSONPath query errors
Direct Known Subclasses
Instance Attribute Summary collapse
- #location ⇒ Location? readonly
- #query ⇒ String readonly
Instance Method Summary collapse
- #detailed_message ⇒ Object
-
#initialize(message, query = nil, location = nil) ⇒ Error
constructor
A new instance of Error.
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(, query = nil, location = nil) super("Jsonpath query #{query} - #{message}") @query = query @location = location end |
Instance Attribute Details
#location ⇒ Location? (readonly)
12 13 14 |
# File 'lib/janeway/error.rb', line 12 def location @location end |
#query ⇒ String (readonly)
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 msg = "Error: #{message}\nQuery: #{query}\n" msg += "#{' ' * location.col}^" if @location msg end |