Sarojini-T opened a new pull request, #10187:
URL: https://github.com/apache/gravitino/pull/10187

   ### What changes were proposed in this pull request?
   - Moved the logging of request.getName() inside the try block to avoid 
accessing a null object
   - Added a guard clause to fail fast with an IllegalArgumentException if the 
request body is null
   - Ensured the exception handler in the catch block is null-safe
   - Added a unit test testCreateSchemaWithNullRequestShouldNotThrow to verify 
the fix
   
   ### Why are the changes needed?
   
   Sending a null request body to createSchema causes a raw 
NullPointerException before the try-catch block, resulting in an inconsistent 
500 error instead of a proper validation error.
   
   Fix: #10164
   
   ### Does this PR introduce _any_ user-facing change?
   
   No user-facing changes were introduced.
   
   ### How was this patch tested?
   
   1. Added a new JUnit test case in TestSchemaOperations.java: 
testCreateSchemaWithNullRequestShouldNotThrow
   2. Ran ./gradlew :server:test --tests 
"org.apache.gravitino.server.web.rest.TestSchemaOperations" and verified all 
tests passed


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