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

   ### What changes were proposed in this pull request?
   
   `NoSuchEntityException` is re-parented from `RuntimeException` to 
`NotFoundException`. Message formatting is unchanged (it delegates to the 
existing `@FormatMethod` chain).
   
   ### Why are the changes needed?
   
   Extending `RuntimeException` directly put it outside the 
`GravitinoRuntimeException`/`NotFoundException` hierarchy its siblings use, so 
`catch (NotFoundException)`/`catch (GravitinoRuntimeException)` missed it and a 
raw escape mapped to HTTP 500 instead of 404.
   
   Fix: #13234
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. A `NoSuchEntityException` that escapes to the REST layer now maps to 
HTTP 404 instead of 500, like every sibling `NoSuch*` exception. All in-repo 
call sites catch it explicitly and are unaffected; message formatting is 
unchanged.
   
   ### How was this patch tested?
   
   Added `TestExceptions`, which pins that `NoSuchEntityException` is a 
`NotFoundException` and is caught by `catch (NotFoundException)`/`catch 
(GravitinoRuntimeException)`; it fails on the pre-fix tree and passes after the 
fix.
   


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