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

   ## What changes were proposed in this pull request?
   This PR adds a ```validate()``` method to the OwnerDetails class in the 
Gravitino CLI module. The method ensures that entityType is not null before 
proceeding with command execution. If entityType is null, the CLI exits with a 
descriptive error message using ```ErrorMessages.UNKNOWN_ENTITY```.
   This change improves input validation and prevents unexpected behavior 
during command handling.
   
   ## Why are the changes needed?
   Without validation, commands may proceed with a null entityType, leading to 
runtime errors or unclear failures. This update:
   - Adds a safeguard against null entityType
   - Aligns with validation patterns used in other CLI components
   - Enhances user experience with clearer error messaging
   Fix: #8207
   
   ## Does this PR introduce any user-facing change?
   Yes:
   - Users will now receive a clear error message if they attempt to run a 
command without specifying a valid entity type.
   - The CLI will exit gracefully with ErrorMessages.UNKNOWN_ENTITY when 
validation fails.
   
   ## How was this patch tested?
   - Added a unit test to verify that validate() exits with an error when 
entityType is null.
   - Confirmed that valid OwnerDetails instances pass validation successfully.
   


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