Exception: Bolt::Inventory::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/bolt/inventory.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#error_code, #issue_code, #kind

Instance Method Summary collapse

Methods inherited from Error

#msg, #to_h, #to_json, #to_puppet_error, unknown_plan, unknown_task

Constructor Details

#initialize(message, offending_group) ⇒ ValidationError

Returns a new instance of ValidationError.



15
16
17
18
19
# File 'lib/bolt/inventory.rb', line 15

def initialize(message, offending_group)
  super(msg, 'bolt.inventory/validation-error')
  @_message = message
  @path = offending_group ? [offending_group] : []
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



14
15
16
# File 'lib/bolt/inventory.rb', line 14

def path
  @path
end

Instance Method Details

#add_parent(parent_group) ⇒ Object



25
26
27
# File 'lib/bolt/inventory.rb', line 25

def add_parent(parent_group)
  @path << parent_group
end

#detailsObject



21
22
23
# File 'lib/bolt/inventory.rb', line 21

def details
  { 'path' => path }
end

#messageObject



29
30
31
# File 'lib/bolt/inventory.rb', line 29

def message
  "#{@_message} for group at #{path}"
end