Display error message when unrecoverable error occurred

PR #19462.
This commit is contained in:
Vladimir Golovnev
2023-08-14 16:03:57 +03:00
parent 67d340ad63
commit 2a04a4d077
4 changed files with 47 additions and 21 deletions

View File

@@ -51,6 +51,7 @@
#include <QStringList>
#include <QUrl>
#include "base/exceptions.h"
#include "base/global.h"
#include "base/logger.h"
#include "base/preferences.h"
@@ -1701,6 +1702,7 @@ void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathLi
}
void TorrentImpl::reload()
try
{
m_completedFiles.fill(false);
m_filesProgress.fill(0);
@@ -1743,6 +1745,11 @@ void TorrentImpl::reload()
updateState();
}
catch (const lt::system_error &err)
{
throw RuntimeError(tr("Failed to reload torrent. Torrent: %1. Reason: %2")
.arg(id().toString(), QString::fromLocal8Bit(err.what())));
}
void TorrentImpl::pause()
{