From 6f2e11550316fb76b77ff9a6bf5bbc9f18caed10 Mon Sep 17 00:00:00 2001 From: pancx Date: Wed, 18 Dec 2024 19:00:52 +0800 Subject: [PATCH] [#5831] fix(CLI): Fix Dropping a metalake via the Gravitino CLI gives an "in use" exception. Dropping a metalake via the Gravitino CLI gives an "in use" exception.if a metalake in use, it should give some hints. --- .../java/org/apache/gravitino/cli/commands/DeleteMetalake.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/DeleteMetalake.java b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/DeleteMetalake.java index 2162d181837..ca1c64ae760 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/DeleteMetalake.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/DeleteMetalake.java @@ -22,6 +22,7 @@ import org.apache.gravitino.cli.AreYouSure; import org.apache.gravitino.cli.ErrorMessages; import org.apache.gravitino.client.GravitinoAdminClient; +import org.apache.gravitino.exceptions.MetalakeInUseException; import org.apache.gravitino.exceptions.NoSuchMetalakeException; public class DeleteMetalake extends Command { @@ -57,6 +58,8 @@ public void handle() { } catch (NoSuchMetalakeException err) { System.err.println(ErrorMessages.UNKNOWN_METALAKE); return; + } catch (MetalakeInUseException inUseException) { + System.err.println(metalake + " in use, plz disable it."); } catch (Exception exp) { System.err.println(exp.getMessage()); return;