Skip to content

Commit 64a8755

Browse files
hebastoryanofsky
andcommitted
qt: Add BitcoinApplication::handleNonFatalException function
This helper function will be used in the following commits. Co-authored-by: Russell Yanofsky <[email protected]>
1 parent af7e365 commit 64a8755

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/qt/bitcoin.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,16 @@ void BitcoinApplication::handleRunawayException(const QString &message)
426426
::exit(EXIT_FAILURE);
427427
}
428428

429+
void BitcoinApplication::handleNonFatalException(const QString& message)
430+
{
431+
assert(QThread::currentThread() == thread());
432+
QMessageBox::warning(
433+
nullptr, tr("Internal error"),
434+
tr("An internal error occurred. %1 will attempt to continue safely. This is "
435+
"an unexpected bug which can be reported as described below.").arg(PACKAGE_NAME) %
436+
QLatin1String("<br><br>") % GUIUtil::MakeHtmlLink(message, PACKAGE_BUGREPORT));
437+
}
438+
429439
WId BitcoinApplication::getMainWinId() const
430440
{
431441
if (!window)

src/qt/bitcoin.h

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ public Q_SLOTS:
9999
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
100100
void handleRunawayException(const QString &message);
101101

102+
/**
103+
* A helper function that shows a message box
104+
* with details about a non-fatal exception.
105+
*/
106+
void handleNonFatalException(const QString& message);
107+
102108
Q_SIGNALS:
103109
void requestedInitialize();
104110
void requestedShutdown();

0 commit comments

Comments
 (0)