lasdf1234 opened a new pull request, #14481:
URL: https://github.com/apache/gravitino/pull/14481

   ### What changes were proposed in this pull request?
   
   - Map Iceberg `NotFoundException` to 404 and `IllegalStateException` to 400 
in `IcebergExceptionMapper` (the table previously only matched 
`javax.ws.rs.NotFoundException`).
   - Rethrow `ValidationException` from `planTableScan` instead of wrapping it 
as `RuntimeException`, so bad filters return 400.
   - Reject missing POST bodies (and incomplete rename/create-namespace bodies 
in authz handlers) with 400 via `IcebergExceptionMapper.missingRequestBody` / 
`BadRequestException`, instead of 500 NPE or 403.
   
   ### Why are the changes needed?
   
   Fixes #14302, #14417, #14421.
   
   Clients currently treat malformed Iceberg REST requests as server failures 
(500) or authorization denials (403), which causes incorrect retries and masks 
bad input.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes.
   - Iceberg REST client errors that used to return 500/403 now return 4xx with 
the Iceberg error model.
   - Missing POST bodies return 400 with a clear message (same pattern as 
plan/tasks).
   
   ### How was this patch tested?
   
   - `./gradlew :iceberg:iceberg-rest-server:test --tests 
org.apache.gravitino.iceberg.service.TestIcebergExceptionMapper --tests 
org.apache.gravitino.iceberg.service.TestCatalogWrapperForREST.testPlanTableScanRethrowsValidationException
 --tests 
org.apache.gravitino.server.web.filter.TestCreateNamespaceAndRenameAuthzHandlers
 --tests 
org.apache.gravitino.iceberg.service.rest.TestIcebergNamespaceOperations.testPostEndpointsRejectMissingRequestBody
 --tests 
org.apache.gravitino.iceberg.service.rest.TestIcebergTableOperations.testTableMutatingEndpointsRejectMissingRequestBody
 --tests 
org.apache.gravitino.iceberg.service.rest.TestIcebergTableOperations.testScanPlanningEndpointsRejectMissingRequestBody
 --tests 
org.apache.gravitino.iceberg.service.rest.TestIcebergViewOperations.testViewMutatingEndpointsRejectMissingRequestBody
 -PskipITs -PskipDockerTests=true`
   
   
   Made with [Cursor](https://cursor.com)


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

Reply via email to