This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-1.0 by this push:
new 0b45578764 [#8510] improvement(clients): catch NoSuchFilesetException
in ListFilesetProperties.java (#8528)
0b45578764 is described below
commit 0b45578764c01ae727c84e6d0c9ac4bd997ff404
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Sep 11 17:50:46 2025 +0800
[#8510] improvement(clients): catch NoSuchFilesetException in
ListFilesetProperties.java (#8528)
### What changes were proposed in this pull request?
Extend the exception handling in `ListFilesetProperties.java` to
explicitly catch `NoSuchFilesetException` and exit with the appropriate
error message (`UNKNOWN_FILESET`).
### Why are the changes needed?
Previously, the CLI already handled `NoSuchMetalakeException`,
`NoSuchCatalogException`, and `NoSuchSchemaException` with clear error
messages.
However, when a fileset did not exist, the CLI would fall through to the
generic `Exception` catch block, resulting in a less user-friendly
message.
Adding explicit handling for `NoSuchFilesetException` ensures consistent
error reporting across all “not found” scenarios.
Fix: #8510
### Does this PR introduce _any_ user-facing change?
Yes.
Users now receive a standardized `UNKNOWN_FILESET` error message when
attempting to list properties of a non-existent fileset, aligning the
behavior with other missing-entity errors.
### How was this patch tested?
N/A
Co-authored-by: Khawaja Abdullah Ansar <[email protected]>
---
.../java/org/apache/gravitino/cli/commands/ListFilesetProperties.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListFilesetProperties.java
b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListFilesetProperties.java
index a7e97fa50f..47fad1f979 100644
---
a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListFilesetProperties.java
+++
b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListFilesetProperties.java
@@ -25,6 +25,7 @@ import org.apache.gravitino.cli.CommandContext;
import org.apache.gravitino.cli.ErrorMessages;
import org.apache.gravitino.client.GravitinoClient;
import org.apache.gravitino.exceptions.NoSuchCatalogException;
+import org.apache.gravitino.exceptions.NoSuchFilesetException;
import org.apache.gravitino.exceptions.NoSuchMetalakeException;
import org.apache.gravitino.exceptions.NoSuchSchemaException;
import org.apache.gravitino.file.Fileset;
@@ -73,6 +74,8 @@ public class ListFilesetProperties extends ListProperties {
exitWithError(ErrorMessages.UNKNOWN_CATALOG);
} catch (NoSuchSchemaException err) {
exitWithError(ErrorMessages.UNKNOWN_SCHEMA);
+ } catch (NoSuchFilesetException err) {
+ exitWithError(ErrorMessages.UNKNOWN_FILESET);
} catch (Exception exp) {
exitWithError(exp.getMessage());
}