diff options
author | TheCharlatan <seb.kung@gmail.com> | 2024-03-15 21:42:44 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2024-03-21 16:40:22 +0100 |
commit | ddc7872c08b7ddf9b1e83abdb97c21303f4a9172 (patch) | |
tree | c63f192aea2ef0dc8e14532720afbea46f21853a /src/bitcoin-chainstate.cpp | |
parent | b50554babdddf452acaa51bac757736766c70e81 (diff) | |
download | bitcoin-ddc7872c08b7ddf9b1e83abdb97c21303f4a9172.tar.xz |
node: Make translations of fatal errors consistent
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.
Diffstat (limited to 'src/bitcoin-chainstate.cpp')
-rw-r--r-- | src/bitcoin-chainstate.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index 3eb64aa344..642af06e82 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -89,14 +89,13 @@ int main(int argc, char* argv[]) { std::cout << "Warning: " << warning.original << std::endl; } - void flushError(const std::string& debug_message) override + void flushError(const bilingual_str& message) override { - std::cerr << "Error flushing block data to disk: " << debug_message << std::endl; + std::cerr << "Error flushing block data to disk: " << message.original << std::endl; } - void fatalError(const std::string& debug_message, const bilingual_str& user_message) override + void fatalError(const bilingual_str& message) override { - std::cerr << "Error: " << debug_message << std::endl; - std::cerr << (user_message.empty() ? "A fatal internal error occurred." : user_message.original) << std::endl; + std::cerr << "Error: " << message.original << std::endl; } }; auto notifications = std::make_unique<KernelNotifications>(); |