lasdf1234 opened a new issue, #13686:
URL: https://github.com/apache/gravitino/issues/13686

   ### Version
   
   main branch (also observed on Datastrato Enterprise 1.3.0-rc9)
   
   ### Describe what's wrong
   
   When a client calls an Iceberg REST endpoint with an `Accept` header the 
service does not serve (e.g. Gravitino's `application/vnd.gravitino.v1+json`), 
JAX-RS correctly raises `NotAcceptableException` (HTTP 406). 
`IcebergExceptionMapper` does not treat `WebApplicationException` specially, so 
the unmapped exception falls through to the default **500** Iceberg error body.
   
   The response message already says "HTTP 406 Not Acceptable", but 
`error.code` is 500, which incorrectly signals a server failure.
   
   ### Error message and/or stacktrace
   
   ```json
   {"error":{"message":"HTTP 406 Not 
Acceptable","type":"NotAcceptableException","code":500}}
   ```
   
   ### How to reproduce
   
   1. Start Gravitino with Iceberg REST enabled.
   2. `GET /iceberg/v1/config?warehouse=<warehouse>` with a valid bearer token 
and
      `Accept: application/vnd.gravitino.v1+json`.
   3. Observe Iceberg error body `code: 500` instead of `406`.
   
   ### Additional context
   
   Iceberg REST only registers `IcebergExceptionMapper` (no 
`WebApplicationExceptionMapper` like `/api/*`). Fix by preserving the status 
already carried by `WebApplicationException` (covers 406/405/415, etc.).


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