-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Search before asking
- I searched in the issues and found nothing similar.
Version
OS: macOS (darwin)
IoTDB: master branch
Describe the bug and provide the minimal reproduce step
IOTDB_ERROR_PREFIX is "Error" (no space). In Cli.java it is concatenated directly with the message in three places, so the user sees:
- Line ~94:
IOTDB_ERROR_PREFIX + "Input params error because"→ "ErrorInput params error because..." - Line ~97:
IOTDB_ERROR_PREFIX + "Exit cli with error "→ "ErrorExit cli with error ..." - Line ~191:
IOTDB_ERROR_PREFIX + "Can't execute sql because"→ "ErrorCan't execute sql because..."
Elsewhere (e.g. line ~176) the code uses IOTDB_ERROR_PREFIX + ": " + message, so the prefix is inconsistent.
Minimal steps:
- Run the CLI (e.g.
./sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw rootfrom a distribution, or runClimain with those args). - Trigger one of these paths: e.g. run with missing required host (
-h), or run with-e "sql"when the server is down. - Observe the printed error: "Error" and the rest of the message are not separated (e.g. "ErrorInput params error because...").
Relevant file: iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java (lines 94, 97, 191).
What did you expect to see?
All CLI error lines should look like "Error: <message>" (prefix, then separator, then message). For example: Error: Input params error because ...
What did you see instead?
Three error paths print "ErrorInput...", "ErrorExit...", and "ErrorCan't..." with no space or colon after "Error", so the message is hard to read.
Anything else?
Proposed fix: Use a separator after the prefix for these three messages (e.g. IOTDB_ERROR_PREFIX + ": " + message), consistent with the existing usage around line 176. No behavior change; formatting/UX only.
Are you willing to submit a PR?
- I'm willing to submit a PR!