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

Backport: Throw better error on invalid resources actions #7836

Merged
merged 2 commits into from
Nov 1, 2018

Conversation

tas50
Copy link
Contributor

@tas50 tas50 commented Oct 31, 2018

Improve the error message when actions are wrong. This is a super confusing error message to get during cookbook development.

tas50 added 2 commits October 31, 2018 14:24
Right now if a user enters an incorrect action they get a message like
this that doesn't print the actions as being symbols. That's super
confusing to new users and results in random cookbook bugs from time to
time.

[2018-10-07T13:26:39-07:00] FATAL: Chef::Exceptions::ValidationFailed: Option action must be equal to one of: nothing, create, remove, modify, manage, lock, unlock!  You passed :whatever.

With this change we properly print out symbols as symbols so it's clear
what the available values are.

[2018-10-07T13:24:09-07:00] FATAL: Chef::Exceptions::ValidationFailed: Option action must be equal to one of: :nothing, :create, :remove, :modify, :manage, :lock, :unlock!  You passed :whatever.

It's a small thing, but I think this will have a pretty big impact on
first time users. This one tripped me up when I first started.

Signed-off-by: Tim Smith <[email protected]>
@tas50 tas50 requested a review from a team October 31, 2018 21:31
@tas50 tas50 merged commit b399ed3 into chef-13 Nov 1, 2018
@chef-ci chef-ci deleted the better_error_13 branch November 1, 2018 18:12
@lock
Copy link

lock bot commented Dec 31, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant