Exception: R10K::Settings::List::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/r10k/settings/list.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from Error

wrap

Constructor Details

#initialize(mesg, options = {}) ⇒ ValidationError

Returns a new instance of ValidationError.



79
80
81
82
# File 'lib/r10k/settings/list.rb', line 79

def initialize(mesg, options = {})
  super
  @errors = options[:errors]
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



77
78
79
# File 'lib/r10k/settings/list.rb', line 77

def errors
  @errors
end

Instance Method Details

#formatObject



84
85
86
87
88
89
90
91
# File 'lib/r10k/settings/list.rb', line 84

def format
  struct = []
  struct << "#{message}:"
  @errors.each do |item, error|
    struct << indent(structure_exception("Item #{item}", error))
  end
  struct.join("\n")
end