Skip to content

If the search result is empty, it returns 404 response.#51

Open
tokibito wants to merge 1 commit into
openresty:masterfrom
tokibito:master
Open

If the search result is empty, it returns 404 response.#51
tokibito wants to merge 1 commit into
openresty:masterfrom
tokibito:master

Conversation

@tokibito

Copy link
Copy Markdown

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

agentzh commented May 16, 2017

Copy link
Copy Markdown
Member

@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

agentzh commented May 16, 2017

Copy link
Copy Markdown
Member

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

@tokibito

tokibito commented May 16, 2017

Copy link
Copy Markdown
Author

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

@tokibito

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