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


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/TableAudit.java:
##########
@@ -48,15 +53,26 @@ public TableAudit(
   /** Displays the audit information of a table. */
   @Override
   public void handle() {
-    Table gTable = null;
-
     try {
       NameIdentifier name = NameIdentifier.of(schema, table);
-      gTable = tableCatalog().loadTable(name);
+      Table gTable = tableCatalog().loadTable(name);
+
+      if (gTable == null) {
+        exitWithError("Failed to retrieve table details.");
+        return;
+      }
+
+      displayAuditInfo(gTable.auditInfo());
+    } catch (NoSuchMetalakeException err) {
+      exitWithError(ErrorMessages.UNKNOWN_METALAKE);
+    } catch (NoSuchCatalogException err) {
+      exitWithError(ErrorMessages.UNKNOWN_CATALOG);
+    } catch (NoSuchSchemaException err) {
+      exitWithError(ErrorMessages.UNKNOWN_SCHEMA);
+    } catch (NoSuchTableException err) {
+      exitWithError(ErrorMessages.UNKNOWN_TABLE);

Review Comment:
   Are you sure loadTable can throw these exceptions?



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