diff --git a/libraries/chef_nexus.rb b/libraries/chef_nexus.rb index 43730c2..9ed6cd7 100644 --- a/libraries/chef_nexus.rb +++ b/libraries/chef_nexus.rb @@ -220,6 +220,12 @@ def encrypted_data_bag_item(node, data_bag, data_bag_item) Mash.from_hash(item.to_hash) rescue Net::HTTPServerException => e nil + + # chef_data_bag_item.rb fails to handle scenario of missing data bag :-(, + # it reports this as Chef::Exceptions::ValidationFailed exception. + # Adding a different rescue block if things exception needs to be handled differently + rescue Chef::Exceptions::ValidationFailed => e + nil end end end