[ 
https://issues.apache.org/jira/browse/SOLR-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14378934#comment-14378934
 ] 

Shawn Heisey commented on SOLR-7243:
------------------------------------

Initial comments, after a quick glance and before I have applied the patch and 
tried to digest it:

In a couple of places, you are casting an exception to SolrException .. but in 
both cases, because of the way the code is written, you can already be assured 
that the exception *is* a SolrException (or a derivative class).  Is a cast 
really necessary?


> 4.10.3 SolrJ is throwing a SERVER_ERROR exception instead of BAD_REQUEST
> ------------------------------------------------------------------------
>
>                 Key: SOLR-7243
>                 URL: https://issues.apache.org/jira/browse/SOLR-7243
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.10.3
>            Reporter: Hrishikesh Gadre
>            Priority: Minor
>         Attachments: SOLR-7243.patch, SOLR-7243.patch, SOLR-7243.patch
>
>
> We found this problem while upgrading Solr from 4.4 to 4.10.3. Our 
> integration test is similar to this Solr unit test,
> https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java
> Specifically we test if the Solr server returns BAD_REQUEST when provided 
> with incorrect input.The only difference is that it uses CloudSolrServer 
> instead of HttpSolrServer. The CloudSolrServer always returns SERVER_ERROR 
> error code. Please take a look
> https://github.com/apache/lucene-solr/blob/817303840fce547a1557e330e93e5a8ac0618f34/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java#L359
> I think we can improve the error handling by checking if the first exception 
> in the list is of type SolrException and if that is the case return the error 
> code associated with that exception. If the first exception is not of type 
> SolrException, then we can return SERVER_ERROR code. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to