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

Return HTTP 400 Bad Request on Solr parse error #224

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Conversation

lamont-granquist
Copy link
Contributor

@lamont-granquist lamont-granquist commented Jul 19, 2016

Previously, chef-zero would return an HTTP 500 Internal Server Error
when the Solr parser failed. Now, we return HTTP 400 with an error
message identical to that of the Erchef server. Returning HTTP 400
also improves the end-user experience since knife returns more
sensible error messages.

Before this patch:

> knife search nodes 'recipes:bar::bar'
ERROR: Server returned error 500 for http://127.0.0.1:8889/search...

After:

> knife search nodes 'recipes:bar::bar'
ERROR: knife search failed: invalid search query: 'recipes:bar::bar'

closes #101

Previously, chef-zero would return an HTTP 500 Internal Server Error
when the Solr parser failed.  Now, we return HTTP 400 with an error
message identical to that of the Erchef server. Returning HTTP 400
also improves the end-user experience since knife returns more
sensible error messages.

Before this patch:

    > knife search nodes 'recipes:bar::bar'
    ERROR: Server returned error 500 for http://127.0.0.1:8889/search...

After:

    > knife search nodes 'recipes:bar::bar'
    ERROR: knife search failed: invalid search query: 'recipes:bar::bar'
@lamont-granquist
Copy link
Contributor Author

rebase of #101

@smurawski
Copy link

👍

@thommay
Copy link
Contributor

thommay commented Jul 19, 2016

👍 LGTM

@thommay thommay merged commit 1c8b088 into master Jul 19, 2016
@thommay thommay added Type: Enhancement Adds new functionality. and removed enhancement labels Jan 24, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants