rshdhere commented on code in PR #18473:
URL: https://github.com/apache/iceberg/pull/18473#discussion_r4253725021


##########
core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java:
##########
@@ -337,6 +338,8 @@ public void accept(ErrorResponse error) {
         case 400:
           if 
(IllegalArgumentException.class.getSimpleName().equals(error.type())) {
             throw new IllegalArgumentException(error.message());
+          } else if 
(ValidationException.class.getSimpleName().equals(error.type())) {
+            throw new ValidationException("%s", error.message());

Review Comment:
    Agreed, it's worth calling out. The `IllegalArgumentException` branch just 
above already rethrows a non-`RESTException` type for 400s, and this follows 
the same pattern. Nothing outside the tests catches RESTException or 
`BadRequestException`. Both `BadRequestException` and `ValidationException` 
implement `CleanableFailure`, so commit cleanup works the same as before. The 
change anyone would notice: a caller that catches `RESTException` to handle a 
400 `ValidationException` from the server won't catch it anymore. I'll mention 
this in the PR description.



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