Aamir017 commented on issue #8291: URL: https://github.com/apache/gravitino/issues/8291#issuecomment-3226863479
### Summary This PR improves error handling in `OwnerDetails.java` by adding a null check for `entityType`. If an invalid or unknown entity type is provided, the CLI now exits with `ErrorMessages.UNKNOWN_ENTITY`. ### Changes Made - Added a null check in `OwnerDetails.handle()` to ensure safe execution. - Now exits early with `ErrorMessages.UNKNOWN_ENTITY` when entity type is invalid. ### Why - Before this fix, calling `handle()` directly (without `validate()`) with an invalid type could cause unexpected behavior. - The new test (`testHandle_withoutValidate_shouldExitWithUnknownEntity`) now passes successfully after this change. ### Notes - No changes were made to unrelated files like `CreateSchema.java`; those warnings/errors are not part of this improvement. - Verified locally with `./gradlew build` → build 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]
