Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly better usability of exception messages #7897

Merged
merged 1 commit into from Nov 26, 2019

Conversation

alexey-milovidov
Copy link
Member

Changelog category (leave one):

  • Improvement

Changelog entry (up to few sentences, required except for Non-significant/Documentation categories):
Slightly better usability of error messages. Ask user not to remove the lines below Stack trace:.

@alexey-milovidov alexey-milovidov added the pr-improvement Pull request with some product improvements label Nov 23, 2019
@stavrolia stavrolia merged commit 953f3a5 into master Nov 26, 2019
@alexey-milovidov
Copy link
Member Author

@stavrolia

milovidov@milovidov-nix:~/work/ClickHouse/dbms$ find . -name '*.h' -or -name '*.cpp' | xargs grep -F 'stack trace:'
./src/Storages/MergeTree/ReplicatedMergeTreeRestartingThread.cpp:            LOG_ERROR(log, "Couldn't start replication: " << e.what() << ", " << e.displayText() << ", stack trace:\n" << e.getStackTrace().toString());
./src/Storages/MergeTree/ReplicatedMergeTreeRestartingThread.cpp:            LOG_ERROR(log, "Couldn't start replication: " << e.what() << ", " << e.displayText() << ", stack trace:\n" << e.getStackTrace().toString());
./src/Databases/DatabaseOrdinary.cpp:        "Cannot create object '" + query.table + "' from query " + serializeAST(query) + ", error: " + e.displayText() + ", stack trace:\n"
./src/Databases/DatabaseOrdinary.cpp:                "Cannot parse definition from metadata file " + full_path + ", error: " + e.displayText() + ", stack trace:\n"
./src/Databases/DatabaseLazy.cpp:            ", stack trace:\n" + e.getStackTrace().toString(),

@alexey-milovidov
Copy link
Member Author

Looks like you did not reviewed this PR properly.

Now you have to fix the following remaining things:

  • the Stack trace text should always have capital S for consistency and the ease of grep;
  • do not format the error message by yourself if getCurrentExceptionMessage or getExceptionMessage functions can be used - to lower the number of places in code where error message is formatted.

@stavrolia
Copy link
Contributor

@alexey-milovidov, yeah, it’s a good idea to reduce the amount of copy paste here, see the follow up PR (#7936).

Could you clarify how I can improve my review process though? The present change looks good to me in isolation, and I don’t see any mistakes in review process.

alexey-milovidov added a commit that referenced this pull request Nov 28, 2019
…ent-of-usability-of-exception-messages

The rest of PR #7897 about improvement of exception message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants