Including exception what() in Runaway dialog box #876

pull Krellan wants to merge 1 commits into bitcoin-core:master from Krellan:exception-what changing 2 files +19 −2
  1. Krellan commented at 8:48 am on May 26, 2025: contributor

    If an exception happens, including e.what() in the text passed to the dialog box, so that the user can see it. This is in addition to any text from getWarnings() that might already be present, separated by newlines if so.

    This will make it easier for users to find what went wrong and get the help they need, instead of having to tell the user to go back and dig through the debug.log file.

  2. DrahtBot commented at 8:48 am on May 26, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  3. in src/qt/initexecutor.cpp:40 in 36557c9a17 outdated
    34@@ -34,7 +35,15 @@ InitExecutor::~InitExecutor()
    35 void InitExecutor::handleRunawayException(const std::exception* e)
    36 {
    37     PrintExceptionContinue(e, "Runaway exception");
    38-    Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings().translated));
    39+    std::string message = m_node.getWarnings().translated;
    40+    if (e) {
    41+        std::string what = e->what();
    


    furszy commented at 11:52 am on May 26, 2025:
    const std::string&

    Krellan commented at 3:27 am on May 27, 2025:
    Good catch, made “what” a const ref. The string “message” is unchanged because it gets modified later in the function.
  4. in src/qt/bitcoin.cpp:685 in 36557c9a17 outdated
    680@@ -680,7 +681,13 @@ int GuiMain(int argc, char* argv[])
    681         }
    682     } catch (const std::exception& e) {
    683         PrintExceptionContinue(&e, "Runaway exception");
    684-        app.handleRunawayException(QString::fromStdString(app.node().getWarnings().translated));
    685+        std::string message = app.node().getWarnings().translated;
    686+        std::string what = e.what();
    


    furszy commented at 11:52 am on May 26, 2025:
    const std::string&

    Krellan commented at 3:27 am on May 27, 2025:
    Good catch, made “what” a const ref. The string “message” is unchanged because it gets modified later in the function.
  5. furszy commented at 1:43 pm on May 26, 2025: member

    If an exception happens, including e.what() in the text passed to the dialog box, so that the user can see it. This is in addition to any text from getWarnings() that might already be present, separated by newlines if so.

    Have you verified that we won’t output the same error message twice?

  6. Krellan commented at 3:20 am on May 27, 2025: contributor
    As for the CI, it failed the Windows build because the URL https://github.com/boostorg/move/archive/boost-1.87.0.tar.gz: is no longer found. It’s not related to this pull request.
  7. Including exception what() in Runaway dialog box
    If an exception happens, including e.what() in the text passed to the dialog
    box, so that the user can see it.  This is in addition to any text from
    getWarnings() that might already be present, separated by newlines if so.
    
    This will make it easier for users to find what went wrong and get the help
    they need, instead of having to tell the user to go back and dig through the
    debug.log file.
    42f7fb724f
  8. Krellan force-pushed on May 27, 2025
  9. Krellan commented at 3:47 am on May 27, 2025: contributor

    Have you verified that we won’t output the same error message twice?

    I looked at the Warning class, and looked at its usages, and the messages that are passed in differ from the text that would arise if an exception were to be thrown (they come from different areas of the code).


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-06-13 15:20 UTC

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