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

Hrishikesh Gadre updated SOLR-7243:
-----------------------------------
    Attachment: SOLR-7243.patch

[~elyograg] A new patch against the trunk. 

Improved the error handling such that
1. error code corresponding to first exception is used (if possible) while 
throwing the RouteException.
2. Ensure that the SolrServerException does not gobble up the SolrException 
(which contains the actual error code). Note that as per the documentation, 
SolrServerException should be used only for communication / parsing issues 
associated with talking to SOLR. Hence it can not represent valid errors 
returned by the Solr server (since it does not have error-code associated with 
it).
    
Also added a unit test to verify the changes.


> 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
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to