Exception: MotherBrain::DataBagItemNotFound

Inherits:
ChefError show all
Defined in:
lib/mb/errors.rb

Constant Summary

Constants inherited from MBError

MBError::DEFAULT_EXIT_CODE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MBError

#error_code, error_code, exit_code, #exit_code, #to_hash, #to_json, #to_s

Constructor Details

#initialize(data_bag_name, item_name) ⇒ DataBagItemNotFound

Returns a new instance of DataBagItemNotFound.



638
639
640
641
# File 'lib/mb/errors.rb', line 638

def initialize(data_bag_name, item_name)
  @data_bag_name = data_bag_name
  @item_name     = item_name
end

Instance Attribute Details

#data_bag_nameObject (readonly)

Returns the value of attribute data_bag_name.



635
636
637
# File 'lib/mb/errors.rb', line 635

def data_bag_name
  @data_bag_name
end

#item_nameObject (readonly)

Returns the value of attribute item_name.



636
637
638
# File 'lib/mb/errors.rb', line 636

def item_name
  @item_name
end

Instance Method Details

#messageObject



643
644
645
# File 'lib/mb/errors.rb', line 643

def message
  "An item named '#{item_name}' was not found in the '#{data_bag_name}' data bag."
end