miantalha45 opened a new issue, #17191:
URL: https://github.com/apache/iotdb/issues/17191

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/iotdb/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:**
   1. Run the CLI (e.g. `./sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw 
root` from a distribution, or run `Cli` main with those args).
   2. Trigger one of these paths: e.g. run with missing required host (`-h`), 
or run with `-e "sql"` when the server is down.
   3. 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?
   
   - [x] I'm willing to submit a PR!


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