You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2023/01/11 12:45:25 UTC

[GitHub] [sling-org-apache-sling-testing-clients] bdelacretaz commented on a diff in pull request #42: SLING-11748 - Improve logging output of HTTP retries in testing clients

bdelacretaz commented on code in PR #42:
URL: https://github.com/apache/sling-org-apache-sling-testing-clients/pull/42#discussion_r1066948994


##########
src/main/java/org/apache/sling/testing/clients/util/ServerErrorRetryStrategy.java:
##########
@@ -80,4 +83,32 @@ private boolean responseRetryCondition(final HttpResponse response, int... expec
                     statusCode < SC_INTERNAL_SERVER_ERROR + 100;
         }
     }
+
+    /**
+     * Best effort attempt to build a request detail string for logging.
+     */
+    private String getRequestDetails(HttpContext context) {
+        String details = "Not available";
+        HttpClientContext clientContext = HttpClientContext.adapt(context);
+        HttpRequestWrapper wrapper = clientContext.getAttribute(HttpClientContext.HTTP_REQUEST, HttpRequestWrapper.class);
+        if (wrapper != null) {
+            details = wrapper.toString();

Review Comment:
   How do we know that this provides useful information? I could run the code to check, but as it's a third-party class the output could change without notice. Might be worth adding a comment showing what kind of output you expect `toString` to return, to make the intention clear.



-- 
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: dev-unsubscribe@sling.apache.org

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