justinmclean commented on code in PR #6573:
URL: https://github.com/apache/gravitino/pull/6573#discussion_r1976572270


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListFilesetProperties.java:
##########
@@ -59,21 +59,40 @@ public ListFilesetProperties(
   @Override
   public void handle() {
     Fileset gFileset = null;
+    GravitinoClient client = null;
+
     try {
       NameIdentifier name = NameIdentifier.of(schema, fileset);
-      GravitinoClient client = buildClient(metalake);
+      client = buildClient(metalake);
+
       gFileset = 
client.loadCatalog(catalog).asFilesetCatalog().loadFileset(name);
+    } catch (IllegalArgumentException exp) {
+      exitWithError("Invalid schema or fileset name: " + exp.getMessage());
+      return;
     } catch (NoSuchMetalakeException err) {
       exitWithError(ErrorMessages.UNKNOWN_METALAKE);
+      return;
     } catch (NoSuchCatalogException err) {
       exitWithError(ErrorMessages.UNKNOWN_CATALOG);
+      return;
     } catch (NoSuchSchemaException err) {
       exitWithError(ErrorMessages.UNKNOWN_SCHEMA);
+      return;
     } catch (Exception exp) {
       exitWithError(exp.getMessage());
+      return;
+    } finally {
+      if (client != null) {
+        client.close();
+      }

Review Comment:
   This will close the client too soon.



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

Reply via email to