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

   ### What changes were proposed in this pull request?
   
   - In `IcebergExceptionMapper`, preserve the HTTP status from JAX-RS 
`WebApplicationException` instead of defaulting unmapped exceptions to 500.
   - Keep `WebApplicationException` instances in `convertToIcebergException` so 
auth paths that call `getErrorCode` stay consistent.
   - Add unit coverage for 406/405/415 and an Iceberg config integration test 
with `Accept: application/vnd.gravitino.v1+json`.
   
   ### Why are the changes needed?
   
   Content-negotiation failures are client errors (406), not server failures 
(500). Returning 500 misleads clients and monitoring.
   
   Fix: #13686
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Iceberg REST responses for unacceptable `Accept` / unsupported media 
type / disallowed method now return the correct HTTP status and matching 
Iceberg `error.code` (e.g. 406), instead of 500.
   
   ### How was this patch tested?
   
   - `./gradlew :iceberg:iceberg-rest-server:test --tests 
org.apache.gravitino.iceberg.service.TestIcebergExceptionMapper --tests 
org.apache.gravitino.iceberg.service.rest.TestIcebergConfig -PskipITs`
   
   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