summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Vargo <sethvargo@gmail.com>2014-11-03 19:22:16 -0500
committerSeth Vargo <sethvargo@gmail.com>2014-11-03 19:22:16 -0500
commit4db79cadb63ea700747e575228d79bcaaea6a6ca (patch)
tree24b22679d538d57d1e136192e65a86deb6c2cc4d
parent74445dede9611e496556f5e3cd4813475fb698e5 (diff)
downloadchef-sethvargo/site_install_json.tar.gz
Use a real error class when metadata is not foundsethvargo/site_install_json
-rw-r--r--lib/chef/exceptions.rb5
-rw-r--r--lib/chef/knife/cookbook_site_install.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 25f08455fc..d981d4512d 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -142,6 +142,11 @@ class Chef
class IllegalVersionConstraint < NotImplementedError; end
class MetadataNotValid < StandardError; end
+ class MetadataNotFound < StandardError
+ def initialize
+ super "No metadata.rb or metadata.json!"
+ end
+ end
# File operation attempted but no permissions to perform it
class InsufficientPermissions < RuntimeError; end
diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb
index 865f806593..3242dd4297 100644
--- a/lib/chef/knife/cookbook_site_install.rb
+++ b/lib/chef/knife/cookbook_site_install.rb
@@ -179,7 +179,7 @@ class Chef
return md
end
- raise "No metadata.rb or metadata.json!"
+ raise Chef::Exceptions::MetadataNotFound
end
end
end