Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make exception string representations also the message #2

Merged
merged 1 commit into from
Oct 13, 2015

Conversation

danielsdeleo
Copy link
Contributor

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 chef-boneyard/chef-dk#564 (need to ship, bump version constraint and apply a small fix to chef-dk for a similar error case)

@danielsdeleo
Copy link
Contributor Author

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
Copy link

👍

1 similar comment
@tyler-ball
Copy link
Contributor

👍

@danielsdeleo danielsdeleo merged commit bbd5053 into master Oct 13, 2015
@danielsdeleo danielsdeleo deleted the fix-exception-message branch October 13, 2015 21:45
danielsdeleo added a commit to chef-boneyard/chef-dk that referenced this pull request Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants