Pass specific fatal index error string into AbortError as opposed to generic error currently in place (see #21229 for more details)
Fixes #21229.
20 | @@ -21,9 +21,10 @@ template <typename... Args> 21 | static void FatalError(const char* fmt, const Args&... args) 22 | { 23 | std::string strMessage = tfm::format(fmt, args...); 24 | + const char* cStrMessage = strMessage.c_str(); 25 | SetMiscWarning(Untranslated(strMessage)); 26 | LogPrintf("*** %s\n", strMessage); 27 | - AbortError(_("A fatal internal error occurred, see debug.log for details")); 28 | + AbortError(_(cStrMessage));
cleaner IMO to get rid of the variable and just declare it inline
22 | @@ -23,7 +23,7 @@ static void FatalError(const char* fmt, const Args&... args) 23 | std::string strMessage = tfm::format(fmt, args...); 24 | SetMiscWarning(Untranslated(strMessage)); 25 | LogPrintf("*** %s\n", strMessage); 26 | - AbortError(_("A fatal internal error occurred, see debug.log for details")); 27 | + AbortError(_(strMessage.c_str()));
A string can't be translated. Only a string literal.
So the options are:
Untranslated()I opted to mark it as Untranslated.
Resolved all comments, bumping this to reviewers.
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits
@MarcoFalke Rebased
Implementation NACK. Aren't we hiding internal unexpected exception messages intentionally?
Hello,
I got two dialogs after initializing my pruned node with blockfilterindex=1. Tested ACK.
Error: Init: basic block filter index best block of the index goes beyond pruned data. Please disable the index or reindex (which will download the whole blockchain again)
Error: Start: basic block filter index failed to initialize
What I'm not sure about is that we'll hide most exceptions and direct the user to debug.log, but display the errors when they are related to the index.