mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 04:38:04 -06:00
Make WebUI error non-fatal
* Do not exit the app when WebUI is failed for start. * Print the error to stdout. PR #19697. Closes #19695. Closes #19469.
This commit is contained in:
@@ -48,6 +48,7 @@ WebUI::WebUI(IApplication *app)
|
||||
void WebUI::configure()
|
||||
{
|
||||
m_isErrored = false; // clear previous error state
|
||||
m_errorMsg.clear();
|
||||
|
||||
const QString portForwardingProfile = u"webui"_s;
|
||||
const Preferences *pref = Preferences::instance();
|
||||
@@ -113,13 +114,13 @@ void WebUI::configure()
|
||||
}
|
||||
else
|
||||
{
|
||||
const QString errorMsg = tr("Web UI: Unable to bind to IP: %1, port: %2. Reason: %3")
|
||||
m_errorMsg = tr("Web UI: Unable to bind to IP: %1, port: %2. Reason: %3")
|
||||
.arg(serverAddressString).arg(port).arg(m_httpServer->errorString());
|
||||
LogMsg(errorMsg, Log::CRITICAL);
|
||||
qCritical() << errorMsg;
|
||||
LogMsg(m_errorMsg, Log::CRITICAL);
|
||||
qCritical() << m_errorMsg;
|
||||
|
||||
m_isErrored = true;
|
||||
emit fatalError();
|
||||
emit error(m_errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +157,11 @@ bool WebUI::isErrored() const
|
||||
return m_isErrored;
|
||||
}
|
||||
|
||||
QString WebUI::errorMessage() const
|
||||
{
|
||||
return m_errorMsg;
|
||||
}
|
||||
|
||||
bool WebUI::isHttps() const
|
||||
{
|
||||
if (!m_httpServer) return false;
|
||||
|
||||
Reference in New Issue
Block a user