index: display specific error message when fatal index error occurs #21232

pull ali-ahari-hashemi wants to merge 1 commits into bitcoin:master from ali-ahari-hashemi:2021/specific_indexerror_message changing 1 files +1 −1
  1. ali-ahari-hashemi commented at 4:42 am on February 19, 2021: none

    Pass specific fatal index error string into AbortError as opposed to generic error currently in place (see #21229 for more details)

    Fixes #21229.

  2. DrahtBot added the label UTXO Db and Indexes on Feb 19, 2021
  3. in src/index/base.cpp:27 in 89c9ab63bc outdated
    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));
    


    jakeleventhal commented at 4:53 am on February 19, 2021:
    cleaner IMO to get rid of the variable and just declare it inline
  4. in src/index/base.cpp:26 in 92ba4e76b4 outdated
    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()));
    


    MarcoFalke commented at 8:22 am on February 19, 2021:
    A string can’t be translated. Only a string literal.

    MarcoFalke commented at 8:23 am on February 19, 2021:

    So the options are:

    • Mark this as Untranslated()
    • Pass in the translated string from the caller
    • Something else?

    ali-ahari-hashemi commented at 8:46 pm on February 19, 2021:
    I opted to mark it as Untranslated.
  5. ali-ahari-hashemi commented at 2:00 am on February 22, 2021: none
    Resolved all comments, bumping this to reviewers.
  6. MarcoFalke commented at 6:58 am on February 22, 2021: member
  7. index: display specific error message when fatal index error occurs in GUI f7b8b003a9
  8. ali-ahari-hashemi force-pushed on Feb 22, 2021
  9. ali-ahari-hashemi commented at 6:53 pm on February 23, 2021: none
    @MarcoFalke Rebased
  10. luke-jr changes_requested
  11. luke-jr commented at 2:39 am on February 24, 2021: member
    Implementation NACK. Aren’t we hiding internal unexpected exception messages intentionally?
  12. ivanacostarubio commented at 4:38 pm on February 27, 2021: none

    Hello,

    I got two dialogs after initializing my pruned node with blockfilterindex=1. Tested ACK.

    0Error: 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)
    
    0Error: 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.

  13. mzumsande commented at 10:01 pm on March 20, 2022: member
    This was fixed in #21796, so I think that this can be closed (@MarcoFalke)
  14. MarcoFalke closed this on Mar 21, 2022

  15. DrahtBot locked this on Mar 21, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-31 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me