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

Audun Wilhelmsen commented on SOLR-3989:
----------------------------------------

I see that the constructor dont wrap cause, fix to this is to wrap it like 
this: throw new RuntimeException(e);

My trunk code is like this: 

public SolrZkClient(String zkServerAddress, int zkClientTimeout, 
ZkClientConnectionStrategy strat, final OnReconnect onReconnect, int 
clientConnectTimeout) {
  ...
  try {
    ...
  } catch (Throwable e) {
    ...
    throw new RuntimeException();
  }
  ...
}    

                
> RuntimeException thrown by SolrZkClient should wrap cause, have a message, or 
> be SolrException
> ----------------------------------------------------------------------------------------------
>
>                 Key: SOLR-3989
>                 URL: https://issues.apache.org/jira/browse/SOLR-3989
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - java
>    Affects Versions: 4.0
>            Reporter: Colin Bartolome
>
> In a few spots, but notably in the constructor for SolrZkClient, a try-catch 
> block will catch Throwable and throw a new RuntimeException with no cause or 
> message. Either the RuntimeException should wrap the Throwable that was 
> caught, some sort of message should be added, or the type of the exception 
> should be changed to SolrException so calling code can catch these exceptions 
> without casting too broad of a net.
> Reproduce this by creating a CloudSolrServer that points to a URL that is 
> valid, but has no server running:
> CloudSolrServer server = new CloudSolrServer("localhost:9983");
> server.connect();

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to