jahstreet commented on code in PR #2013:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2013#discussion_r2000568199


##########
core/src/main/java/com/datastax/oss/driver/internal/core/ContactPoints.java:
##########
@@ -41,7 +38,22 @@ public static Set<EndPoint> merge(
 
     Set<EndPoint> result = Sets.newHashSet(programmaticContactPoints);
     for (String spec : configContactPoints) {
-      for (InetSocketAddress address : extract(spec, resolve)) {
+
+      Set<InetSocketAddress> addresses = Collections.emptySet();
+      try {
+        addresses = AddressUtils.extract(spec, resolve);
+      } catch (RuntimeException e) {
+        LOG.warn("Ignoring invalid contact point {} ({})", spec, 
e.getMessage(), e);
+      }

Review Comment:
   Previously, `#extract` code was used only in this class and we logged errors 
together with reasons of these errors. Now the info about reasons is moved to 
util method, which is called from multiple places. In this class, I aimed to 
keep logging (as well as other functionality) as close to the origin as seemed 
possible to avoid opinionated refactoring, so I needed a way to get reasons of 
errors from the utility `#extract` to log them together with the context logs.
   Happy to agree on the way it should look like and change accordingly.



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to