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

   **Version**
   main branch
   
   **Describe what's wrong**
   `NoSuchEntityException` extends `RuntimeException` directly, outside the 
`GravitinoRuntimeException`/`NotFoundException` hierarchy every sibling 
`NoSuch*` exception uses. `catch (GravitinoRuntimeException)` and `catch 
(NotFoundException)` blocks silently miss it, and a raw escape maps to HTTP 500 
instead of 404.
   
   **Error message and/or stacktrace**
   N/A: a misclassified exception that maps to HTTP 500 where 404 is expected; 
no new stacktrace.
   
   **How to reproduce**
   Let a `NoSuchEntityException` escape to the REST layer without an explicit 
catch; it maps to HTTP 500 rather than 404, and a `catch (NotFoundException)` 
block does not catch it.
   
   **Additional context**
   Every sibling `NoSuch*` exception is a `NotFoundException`. All in-repo uses 
catch it explicitly as `NoSuchEntityException` and are unaffected. Found during 
a code audit of the `api` module.
   


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