geruh commented on code in PR #14927:
URL: https://github.com/apache/iceberg/pull/14927#discussion_r2649891962


##########
core/src/test/java/org/apache/iceberg/rest/TestHTTPRequest.java:
##########
@@ -32,6 +32,7 @@
 import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;

Review Comment:
   Nit: This test is for ErrorHandlers, not HTTPRequest. Wdyt about making a 
test file for this behavior.



##########
core/src/test/java/org/apache/iceberg/rest/TestHTTPRequest.java:
##########
@@ -213,4 +214,19 @@ public void encodedBodyNull() {
             .build();
     assertThat(request.encodedBody()).isNull();
   }
+
+  @Test
+  public void testErrorHandlerIncludesCodeAndType() {
+    ErrorResponse error =
+        ErrorResponse.builder()
+            .responseCode(422)
+            .withType("ValidationException")
+            .withMessage("Invalid input")
+            .build();
+
+    assertThatThrownBy(() -> ErrorHandlers.defaultErrorHandler().accept(error))

Review Comment:
   Can we add some tests with out the message and type as they're optional



##########
core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java:
##########


Review Comment:
   The namespace handler had a inconsistency in the 422 case, maybe we can 
remove this to fall back to the new behavior in DefaultErrorHandler?



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