You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jason Gerlowski (JIRA)" <ji...@apache.org> on 2017/11/06 12:07:00 UTC
[jira] [Comment Edited] (SOLR-11551) Standardize response codes and
success/failure determination for core-admin api calls
[ https://issues.apache.org/jira/browse/SOLR-11551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240187#comment-16240187 ]
Jason Gerlowski edited comment on SOLR-11551 at 11/6/17 12:06 PM:
------------------------------------------------------------------
I also noticed that anytime a core-API takes in a "core" parameter, but that core doesn't exist, we throw a SolrException with a 400 status-code. This might be better represented as a 404 (NOT FOUND). I don't have a strong opinion whether we implement that, but it does fit things a little maybe.
I left the behavior as-is in the initial patch, since it wasn't in the interface you laid out in the issue description. Just wanted to mention it in case anyone liked the idea...
was (Author: gerlowskija):
I also noticed that anytime a core-API takes in a "core" parameter, but that core doesn't exist, we throw a SolrException with a 400 status-code. This might be better represented as a 404 (NOT FOUND). I don't have a strong opinion whether we implement that, but it does fit things a little maybe.
> Standardize response codes and success/failure determination for core-admin api calls
> -------------------------------------------------------------------------------------
>
> Key: SOLR-11551
> URL: https://issues.apache.org/jira/browse/SOLR-11551
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Varun Thacker
> Attachments: SOLR-11551.patch
>
>
> If we were to tackle SOLR-11526 I think we need to start fixing the core admin api's first.
> If we are relying on response codes I think we should make the following change and fix all the APIs
> {code}
> interface CoreAdminOp {
> void execute(CallInfo it) throws Exception;
> }
> {code}
> To
> {code}
> interface CoreAdminOp {
> /**
> *
> * @param it request/response object
> *
> * If the request is invalid throw a SolrException with SolrException.ErrorCode.BAD_REQUEST ( 400 )
> * If the execution of the command fails throw a SolrException with SolrException.ErrorCode.SERVER_ERROR ( 500 )
> * Add a "error-message" key to the response object with the exception ( this part should be done at the caller of this method so that each operation doesn't need to do the same thing )
> */
> void execute(CallInfo it);
> }
> {code}
> cc [~gerlowskija]
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org