-
Notifications
You must be signed in to change notification settings - Fork 37.7k
validation: Make translations of fatal errors consistent #29672
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach ACK 75ffa4f
src/validation.cpp
Outdated
@@ -4299,7 +4299,7 @@ bool ChainstateManager::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, | |||
} | |||
ReceivedBlockTransactions(block, pindex, blockPos); | |||
} catch (const std::runtime_error& e) { | |||
return FatalError(GetNotifications(), state, std::string("System error: ") + e.what()); | |||
return FatalError(GetNotifications(), state, strprintf(_("System error: %s"), e.what())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: while touching, would be useful to consistently add context (+here)
return FatalError(GetNotifications(), state, strprintf(_("System error: %s"), e.what())); | |
return FatalError(GetNotifications(), state, strprintf(_("System error while writing block to history file: %s"), e.what())); |
75ffa4f
to
9a32540
Compare
Thank you for the review @stickies-v, 75ffa4f -> 9a32540 (fatallogtranslate_0 -> fatallogtranslate_1, compare)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 9a32540
9a32540
to
918efe6
Compare
Updated 9a32540 -> 918efe6 (fatallogtranslate_1 -> fatallogtranslate_2, compare)
|
re-ACK 918efe6 |
918efe6
to
98d0dd9
Compare
Rebased 918efe6 -> 98d0dd9 (fatallogtranslate_2 -> fatallogtranslate_3, compare) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 98d0dd9.
The extra `bilingual_str` argument of the fatal error notifications and `node::AbortNode()` is often unused and when used usually contains the same string as the message argument. It also seems to be confusing, since it is not consistently used for errors requiring user action. For example some assumeutxo fatal errors require the user to do something, but are not translated. So simplify the fatal error and abort node interfaces by only passing a translated string. This slightly changes the fatal errors displayed to the user. Also de-duplicate the abort error log since it is repeated in noui.cpp.
98d0dd9
to
824f472
Compare
Sorry for invalidating those ACKs, but I feel like this is easy enough to look at again. 98d0dd9 -> 824f472 (fatallogtranslate_3 -> fatallogtranslate_4, compare) |
re-ACK 824f472 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 824f472 🔎 Show signatureSignature:
|
ACK 824f472 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working
The extra
bilingual_str
argument of the fatal error notifications andnode::AbortNode()
is often unused and when used usually contains the same string as the message argument. It also seems to be confusing, since it is not consistently used for errors requiring user action. For example some assumeutxo fatal errors require the user to do something, but are not translated.So simplify the fatal error and abort node interfaces by only passing a translated string. This slightly changes the fatal errors displayed to the user.