Exception: Moxml::ParseError
- Defined in:
- lib/moxml/error.rb
Overview
Error raised when parsing XML fails
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(message, line: nil, column: nil, source: nil) ⇒ ParseError
constructor
A new instance of ParseError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, line: nil, column: nil, source: nil) ⇒ ParseError
Returns a new instance of ParseError.
11 12 13 14 15 16 |
# File 'lib/moxml/error.rb', line 11 def initialize(, line: nil, column: nil, source: nil) @line = line @column = column @source = source super() end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
9 10 11 |
# File 'lib/moxml/error.rb', line 9 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
9 10 11 |
# File 'lib/moxml/error.rb', line 9 def line @line end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
9 10 11 |
# File 'lib/moxml/error.rb', line 9 def source @source end |
Instance Method Details
#to_s ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/moxml/error.rb', line 18 def to_s msg = super msg += "\n Line: #{@line}" if @line msg += "\n Column: #{@column}" if @column msg += "\n Source: #{@source.inspect}" if @source msg += "\n Hint: Check XML syntax and ensure all tags are properly closed" msg end |