Exception: SmarterJSON::ParseError
- Defined in:
- lib/smarter_json/errors.rb
Overview
Raised by process / process_file on genuinely unparseable input (unterminated string, mismatched bracket, …). Carries the line and column when known.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(message, line = nil, col = nil) ⇒ ParseError
constructor
A new instance of ParseError.
Constructor Details
#initialize(message, line = nil, col = nil) ⇒ ParseError
Returns a new instance of ParseError.
15 16 17 18 19 |
# File 'lib/smarter_json/errors.rb', line 15 def initialize(, line = nil, col = nil) @line = line @col = col super(line && col ? "#{} at line #{line}, col #{col}" : ) end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
13 14 15 |
# File 'lib/smarter_json/errors.rb', line 13 def col @col end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
13 14 15 |
# File 'lib/smarter_json/errors.rb', line 13 def line @line end |