aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-03-27 18:52:22 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-04-01 03:05:31 +0300
commit64a8755af396f1c2791018510e22b58114e68594 (patch)
treec679b813bf2ac5813ffceea4b6aa650b7da9e2e2 /src
parentaf7e365b1516d660d271475fdfe0c20ae09e66a8 (diff)
qt: Add BitcoinApplication::handleNonFatalException function
This helper function will be used in the following commits. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoin.cpp10
-rw-r--r--src/qt/bitcoin.h6
2 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index aec63ffaf0..de71b7dea7 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -426,6 +426,16 @@ void BitcoinApplication::handleRunawayException(const QString &message)
::exit(EXIT_FAILURE);
}
+void BitcoinApplication::handleNonFatalException(const QString& message)
+{
+ assert(QThread::currentThread() == thread());
+ QMessageBox::warning(
+ nullptr, tr("Internal error"),
+ tr("An internal error occurred. %1 will attempt to continue safely. This is "
+ "an unexpected bug which can be reported as described below.").arg(PACKAGE_NAME) %
+ QLatin1String("<br><br>") % GUIUtil::MakeHtmlLink(message, PACKAGE_BUGREPORT));
+}
+
WId BitcoinApplication::getMainWinId() const
{
if (!window)
diff --git a/src/qt/bitcoin.h b/src/qt/bitcoin.h
index 69e0a5921e..5fd6bd607f 100644
--- a/src/qt/bitcoin.h
+++ b/src/qt/bitcoin.h
@@ -99,6 +99,12 @@ public Q_SLOTS:
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
void handleRunawayException(const QString &message);
+ /**
+ * A helper function that shows a message box
+ * with details about a non-fatal exception.
+ */
+ void handleNonFatalException(const QString& message);
+
Q_SIGNALS:
void requestedInitialize();
void requestedShutdown();