Exception: OCTool::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- OCTool::ValidationError
- Defined in:
- lib/octool/parser.rb
Overview
Custom error to show validation errors.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(path, errors) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #message ⇒ Object
Constructor Details
#initialize(path, errors) ⇒ ValidationError
Returns a new instance of ValidationError.
8 9 10 11 |
# File 'lib/octool/parser.rb', line 8 def initialize(path, errors) @path = path @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/octool/parser.rb', line 6 def errors @errors end |
Instance Method Details
#message ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/octool/parser.rb', line 13 def msg = ["[ERROR] #{@path}"] @errors.each do |e| msg << "line #{e.linenum} col #{e.column} [#{e.path}] #{e.}" end msg.join("\n") end |