danielcweeks commented on code in PR #15648:
URL: https://github.com/apache/iceberg/pull/15648#discussion_r2941858816


##########
core/src/main/java/org/apache/iceberg/rest/HTTPClient.java:
##########
@@ -340,32 +339,23 @@ protected <T extends RESTResponse> T execute(
         return null;
       }
 
-      String responseBody = extractResponseBodyAsString(response);
-
       if (!isSuccessful(response)) {
         // The provided error handler is expected to throw, but a 
RESTException is thrown if not.
+        String responseBody = extractResponseBodyAsString(response);
         throwFailure(response, responseBody, errorHandler);
       }
 
-      if (responseBody == null) {
+      if (response.getEntity() == null) {

Review Comment:
   Are we sure this is the right behavior?  There are a number of valid return 
codes (e.g. `204`) that I believe result in a `null` entity, but are valid.
   
   I'm a little concerned that we're not properly handling all response codes.



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