-
Notifications
You must be signed in to change notification settings - Fork 450
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
Fail Ohai when > 1 collect_data blocks defined per platform #217
Conversation
Not sure if I should find/create a more specific exception to raise than Exception |
@mcquin I would vote to create a new exception class MissingCollectDataBlock to raise here. Also we have other specific exceptions we are raising. Like the ones in: https://github.com/opscode/ohai/blob/master/lib/ohai/runner.rb#L23-L27 We can move these classes to "lib/ohai/exception.rb" similar to the way done in: https://github.com/opscode/chef/blob/master/lib/chef/exceptions.rb |
Also one q. Where are we handling the global exception handling so that OHAI will not stop if a plugin fails and throws an exception? LMK if this question doesn't make sense :) |
end | ||
EOF | ||
IO.stub(:read).with(@path).and_return(contents) | ||
Ohai::Log.should_receive(:warn).with(/is not properly defined/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think checking for the detailed error message here would be better. Error messages we provide should be as specific as possible so that people can debug their things.
Ohai::Log.should_receive(:warn).with(/collect_data already defined on platform/)
Other than one minor comment looking awesome.. 👍 |
@sersut good to merge? |
👍 Looks great :) |
Fail Ohai when > 1 collect_data blocks defined per platform
@sersut