lib/ridley/resources/data_bag_resource.rb in ridley-0.12.0.rc1 vs lib/ridley/resources/data_bag_resource.rb in ridley-0.12.0

- old
+ new

@@ -22,12 +22,13 @@ # @param [String, #chef_id] object # # @return [nil, Ridley::DataBagResource] def find(object) chef_id = object.respond_to?(:chef_id) ? object.chef_id : object - connection.get("#{self.class.resource_path}/#{chef_id}") + request(:get, "#{self.class.resource_path}/#{chef_id}") new(name: chef_id) - rescue Errors::HTTPNotFound - nil + rescue AbortError => ex + return nil if ex.cause.is_a?(Errors::HTTPNotFound) + abort(ex.cause) end end end