yifan-c commented on code in PR #61:
URL: https://github.com/apache/cassandra-sidecar/pull/61#discussion_r1263068193


##########
client/src/main/java/org/apache/cassandra/sidecar/client/exception/RetriesExhaustedException.java:
##########
@@ -28,24 +29,52 @@ public class RetriesExhaustedException extends 
RuntimeException
     /**
      * Constructs an exception with the number of {@code attempts} performed 
for the request.
      *
-     * @param attempts the number of attempts performed for the request
-     * @param request  the HTTP request
+     * @param attempts      the number of attempts performed for the request
+     * @param request       the HTTP request
+     * @param lastResponse  the last failed HTTP response
      */
-    public RetriesExhaustedException(int attempts, Request request)
+    public static RetriesExhaustedException of(int attempts,
+                                               Request request,
+                                               HttpResponse lastResponse)
     {
-        this(attempts, request, null);
+        return of(attempts, request, lastResponse, null);

Review Comment:
   I feel those static creation methods make the code look nicer by eliminating 
the need to explicitly pass null. 



-- 
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