This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 9264b701a93 Do not print host and port when failed to connect through
CLI (#14844)
9264b701a93 is described below
commit 9264b701a93b36ab285f715f42431455ae3fe434
Author: Jiang Tian <[email protected]>
AuthorDate: Mon Feb 17 09:24:12 2025 +0800
Do not print host and port when failed to connect through CLI (#14844)
* Do not pritn host and port when failed to connect through CLI
* Update StartClientScriptIT.java
---------
Co-authored-by: Haonan <[email protected]>
---
.../src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java | 4 ++--
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git
a/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
b/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
index 317ec218fc6..18973720b3e 100644
---
a/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
@@ -77,7 +77,7 @@ public class StartClientScriptIT extends AbstractScript {
protected void testOnWindows() throws IOException {
final String[] output = {
- "Error: Connection Error, please check whether the network is available
or the server has started. Host is 127.0.0.1, port is 6668."
+ "Error: Connection Error, please check whether the network is available
or the server has started."
};
ProcessBuilder builder =
new ProcessBuilder(
@@ -121,7 +121,7 @@ public class StartClientScriptIT extends AbstractScript {
protected void testOnUnix() throws IOException {
final String[] output = {
- "Error: Connection Error, please check whether the network is available
or the server has started. Host is 127.0.0.1, port is 6668."
+ "Error: Connection Error, please check whether the network is available
or the server has started."
};
ProcessBuilder builder =
new ProcessBuilder(
diff --git a/iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
b/iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
index 1f8a354482b..0a9af5a2da7 100644
--- a/iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
+++ b/iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
@@ -210,9 +210,7 @@ public class Cli extends AbstractCli {
}
}
} catch (SQLException e) {
- ctx.getErr()
- .printf(
- "%s: %s Host is %s, port is %s.%n", IOTDB_ERROR_PREFIX,
e.getMessage(), host, port);
+ ctx.getErr().printf("%s: %s%n", IOTDB_ERROR_PREFIX, e.getMessage());
ctx.exit(CODE_ERROR);
}
}