justinmclean commented on code in PR #6573: URL: https://github.com/apache/gravitino/pull/6573#discussion_r1976572402
########## clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListMetalakeProperties.java: ########## @@ -46,17 +46,22 @@ public ListMetalakeProperties(CommandContext context, String metalake) { @Override public void handle() { Metalake gMetalake = null; - try { - GravitinoAdminClient client = buildAdminClient(); + + try (GravitinoAdminClient client = buildAdminClient()) { // Ensure resource cleanup gMetalake = client.loadMetalake(metalake); + + if (gMetalake == null) { + exitWithError("Metalake not found: " + metalake); + return; + } + Review Comment: best to move this outside of the try block. -- 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: commits-unsubscr...@gravitino.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org