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.



655
656
657
658
# File 'lib/mb/errors.rb', line 655

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.



652
653
654
# File 'lib/mb/errors.rb', line 652

def data_bag_name
  @data_bag_name
end

#item_nameObject (readonly)

Returns the value of attribute item_name.



653
654
655
# File 'lib/mb/errors.rb', line 653

def item_name
  @item_name
end

Instance Method Details

#messageObject



660
661
662
# File 'lib/mb/errors.rb', line 660

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