chef / cookbook-omnifetch

Fetch Chef Cookbooks from Various Sources to a Local Cache
Apache License 2.0
6 stars 9 forks source link

Make exception string representations also the message #2

Closed danielsdeleo closed 9 years ago

danielsdeleo commented 9 years ago

In ChefDK, we assume that SomeException#message will be informative, but the exception classes here assume you will be calling SomeException#to_s. By assigning to_s to message, we make everyone happy.

This is a partial fix for https://github.com/chef/chef-dk/issues/564 (need to ship, bump version constraint and apply a small fix to chef-dk for a similar error case)

danielsdeleo commented 9 years ago

BTW, when pulling this patch into chef-dk, when I follow the repro for chef-dk 546, I see:

Building policy example-application-service
Expanded run list: recipe[foo::default]
Caching Cookbooks...
Installing foo >= 0.0.0 from path
Error: Failed to generate Policyfile.lock
Reason: (CookbookOmnifetch::NotACookbook) The resource at '/Users/ddeleo/oc/chef-dk/cookbooks/example_cookbook' does not appear to be a valid cookbook. Does it have a metadata.rb?
ksubrama commented 9 years ago

:+1:

tyler-ball commented 9 years ago

:+1: