Exception: XML_XSI::Schema::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- XML_XSI::Schema::ValidationError
- Defined in:
- lib/validate_xml_xsi.rb
Overview
Unified Error reportign class for both XSD and XML errors
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, err, filename = nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(type, err, filename = nil) ⇒ ValidationError
Returns a new instance of ValidationError.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/validate_xml_xsi.rb', line 74 def initialize(type, err, filename = nil) @type = type @error = err @file = filename.nil? ? @error.file : filename @line = @error.line @column = @error.column if /((?:ERROR)|(?:WARNING)): /.match(@error.) @level = $1 @message = $' @description = "#{@type.to_s} #{@level.to_s} [#{@file}:#{@line}:#{@column}]: #{@message}".freeze else @level = '' @message = @error. @description = "#{@type.to_s} #{@message}".freeze end super(@description) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def column @column end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def description @description end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def error @error end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def file @file end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def level @level end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
73 74 75 |
# File 'lib/validate_xml_xsi.rb', line 73 def type @type end |