[
https://issues.apache.org/jira/browse/SOLR-11551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240310#comment-16240310
]
Shawn Heisey commented on SOLR-11551:
-------------------------------------
On returning 404 errors for specific conditions: I think the 400 response is a
result of consistency in another direction -- I'm not sure that Solr ever
actually returns a 404 response. When the URL is valid but information in the
parameters isn't, I think I've only ever seen 400 (request problem) and 500
(server problem) -- and not just from CoreAdmin. When a 404 response happens
(like what happens with http://host:port/solr/corename base URLs), I believe
it's typically the container that returns that error -- because the URL is
incomplete or invalid, and doesn't get mapped to Solr.
If the error message returned with the 404 is clear enough to indicate the
problem (core not found is one specific scenario) then I am completely on board
with the change. If the only actual information that Solr sends is the HTTP
code, then the change may cause more confusion than clarity. There definitely
should be a specific note made in the "upgrading" section of CHANGES.txt
indicating that HTTP response codes are changing in some circumstances -- not
just a "SOLR-11551" note about the issue being included.
> 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: [email protected]
For additional commands, e-mail: [email protected]