[ 
https://issues.apache.org/jira/browse/SOLR-11551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Gerlowski updated SOLR-11551:
-----------------------------------
    Attachment: SOLR-11551.patch

Sorry this took me so long to get to [~varunthacker]

The attached patch wraps each CoreAdminOp implementation in a try-catch to 
gather up any unexpected 500 errors.  It also adds arg-checking for any 
required core-api params, to return a 400 if any are missing.  Tests for all 
these cases are included in {{CoreAdminOperationTest}}.

As-written, there are a few test failures as a result of the bug reported in 
SOLR-11608.  That small bug maybe blocks this improvement.  I've uploaded a 
1-line-fix over there though, which could be included in this patch as well.  
(Wasn't sure whether to include it or not, since it's a conceptually separate 
problem).

> 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]

Reply via email to