From 86fa507226b484a71a45ef6129840bc3928be6b7 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 27 Jun 2016 15:38:28 -0700 Subject: Attributes v1.1 changes - fixes *_unless behavior and set_unless_value_present hack from Chef 12 - simplifies rm_* code - introduces functional read/write/unlink/exist? API - deprecates method_missing access to attributes for Chef 13 - deprecates set/set_unless aliases for Chef 14 - removes MultiMash mess that I wrote for Chef 13 https://github.com/chef/chef/pull/5029 for more details --- lib/chef/exceptions.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/chef/exceptions.rb') diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index ea90d80cd8..43759568a7 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -106,7 +106,12 @@ class Chef # for back compat, need to raise an error that inherits from ArgumentError class CookbookNotFoundInRepo < ArgumentError; end class RecipeNotFound < ArgumentError; end + # AttributeNotFound really means the attribute file could not be found class AttributeNotFound < RuntimeError; end + # NoSuchAttribute is raised on access by node.read!("foo", "bar") when node["foo"]["bar"] does not exist. + class NoSuchAttribute < RuntimeError; end + # AttributeTypeMismatch is raised by node.write!("foo", "bar", "baz") when e.g. node["foo"] = "bar" (overwriting String with Hash) + class AttributeTypeMismatch < RuntimeError; end class MissingCookbookDependency < StandardError; end # CHEF-5120 class InvalidCommandOption < RuntimeError; end class CommandTimeout < RuntimeError; end -- cgit v1.2.1