ethannguyen128 opened a new pull request, #11816:
URL: https://github.com/apache/gravitino/pull/11816
## What does this PR do?
This PR Fixes a silent exception-masking bug across 15 REST handler classes
in the server/module. Each affected handler logged request.get*() inside its
catch (Exception e) block without first checking whether request was null. When
a null request body caused a primary exception, the catch path's dereference
threw a second NullPointerException that replaced the original failure in the
stack trace which makes the real root cause invisible to operators and
impossible to diagnose from logs alone. The fix precomputes a null-safe name
string before the try block so the catch path always has something safe to log,
and the original exception is always the one that reaches ExceptionHandlers and
the client.
## Why was this PR needed?
Issue #10172 identified that sending a null or empty request body to any of
the affected endpoints would produce a misleading NullPointerException response
pointing at the catch block and not at the actual failure site. For example, a
deserialization failure in CatalogOperations.createCatalog would be silently
swallowed, and the client would receive an NPE originating from
request.getName() in the catch path instead of the real error. This made triage
significantly harder because the original exception context was destroyed
before it could be logged or marshalled. Precomputing the identifier is the
minimal, zero-API-change fix: it keeps all ExceptionHandlers routing intact and
doesn't alter any response contracts.
## What are the relevant issue numbers?
Number #10172
--
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]