[IOTDB-17191] CLI: add space after error prefix in three messages#17192
Open
miantalha45 wants to merge 2 commits intoapache:masterfrom
Open
[IOTDB-17191] CLI: add space after error prefix in three messages#17192miantalha45 wants to merge 2 commits intoapache:masterfrom
miantalha45 wants to merge 2 commits intoapache:masterfrom
Conversation
- ArgsErrorException: 'Error' + ': Input params error because ' - Exception on init: 'Error' + ': Exit cli with error ' - SQLException in executeSql: 'Error' + ': Can't execute sql because ' Fixes missing space after IOTDB_ERROR_PREFIX so messages display as 'Error: ...' instead of 'Error...'. Co-authored-by: Cursor <cursoragent@cursor.com>
6d42129 to
c5885f1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CLI error output formatting by adding a ": " separator after IOTDB_ERROR_PREFIX so affected messages render as Error: ... instead of Error..., addressing #17191.
Changes:
- Add
": "afterIOTDB_ERROR_PREFIXfor argument parsing errors. - Add
": "afterIOTDB_ERROR_PREFIXfor generic CLI exit errors during startup. - Add
": "afterIOTDB_ERROR_PREFIXfor SQL execution errors inexecuteSql().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ctx.exit(CODE_ERROR); | ||
| } catch (Exception e) { | ||
| ctx.getPrinter().println(IOTDB_ERROR_PREFIX + "Exit cli with error " + e.getMessage()); | ||
| ctx.getPrinter().println(IOTDB_ERROR_PREFIX + ": Exit cli with error " + e.getMessage()); |
There was a problem hiding this comment.
The message here says "Exit cli with error " followed immediately by the exception message, while serve() below prints "Exit cli with error: " (note the colon). Consider aligning these so the output is consistent and easier to read (e.g., include the colon before the exception message).
Suggested change
| ctx.getPrinter().println(IOTDB_ERROR_PREFIX + ": Exit cli with error " + e.getMessage()); | |
| ctx.getPrinter().println(IOTDB_ERROR_PREFIX + ": Exit cli with error: " + e.getMessage()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changed
Adds the missing separator after
IOTDB_ERROR_PREFIX("Error") in three CLI error messages so they display as "Error: ..." instead of "Error...".Changes
Error+: Input params error because+ messageError+: Exit cli with error+ messageError+: Can't execute sql because+ messageFixes #17191