Skip to content

Conversation

tokibito
Copy link

If the result of opm search is empty, the response status is 404 and the command result is an error.

# /usr/local/openresty/bin/opm search not-found-keyword
ERROR: failed to search on server: status 404: no search result found.

In this case, I think that the status 200 should be better.

see also:

@agentzh
Copy link
Member

agentzh commented May 16, 2017

@tokibito I have a mixed feeling about this. I think a 404 status code would make it much easier and more reliable to check if there is any hits. Otherwise the client has to parse the content to be sure, which is not reliable.

@agentzh
Copy link
Member

agentzh commented May 16, 2017

@tokibito Maybe we should change the client instead to handle 404 response for the search command specially?

@tokibito
Copy link
Author

tokibito commented May 16, 2017

@agentzh I see. Yes, I agree to change the behavior of the client.

@tokibito
Copy link
Author

@agentzh Is this resolved?

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.

2 participants