JeetKunDoug commented on code in PR #51:
URL: https://github.com/apache/cassandra-sidecar/pull/51#discussion_r1280665513


##########
common/src/main/java/org/apache/cassandra/sidecar/cluster/InstancesConfigImpl.java:
##########
@@ -75,7 +79,18 @@ public InstanceMetadata instanceFromHost(String host) throws 
NoSuchElementExcept
         InstanceMetadata instanceMetadata = hostToInstanceMetadata.get(host);
         if (instanceMetadata == null)
         {
-            throw new NoSuchElementException("Instance with host address " + 
host + " not found");
+            try
+            {
+                instanceMetadata = 
hostToInstanceMetadata.get(dnsResolver.resolve(host));
+            }
+            catch (UnknownHostException e)
+            {
+                throw new RuntimeException(e);

Review Comment:
   So I'd like to be able to include the details of the UnknownHostException, 
but `NoSuchElementException` doesn't have a constructor that takes a cause as 
an argument... for now, will just include some additional text in the 
exception's description.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to