Include resume folder path in exception message

The message in RuntimeError exception will be displayed to the users and
users would be clueless if we don't show the path.
This commit is contained in:
Chocobo1
2020-02-15 02:43:34 +08:00
committed by sledgehammer999
parent 89ee24fb3e
commit 66c2e70016

View File

@@ -3961,11 +3961,13 @@ void Session::initResumeFolder()
if (resumeFolderDir.exists() || resumeFolderDir.mkpath(resumeFolderDir.absolutePath())) { if (resumeFolderDir.exists() || resumeFolderDir.mkpath(resumeFolderDir.absolutePath())) {
m_resumeFolderLock->setFileName(resumeFolderDir.absoluteFilePath("session.lock")); m_resumeFolderLock->setFileName(resumeFolderDir.absoluteFilePath("session.lock"));
if (!m_resumeFolderLock->open(QFile::WriteOnly)) { if (!m_resumeFolderLock->open(QFile::WriteOnly)) {
throw RuntimeError {tr("Cannot write to torrent resume folder.")}; throw RuntimeError {tr("Cannot write to torrent resume folder: \"%1\"")
.arg(Utils::Fs::toNativePath(m_resumeFolderPath))};
} }
} }
else { else {
throw RuntimeError {tr("Cannot create torrent resume folder.")}; throw RuntimeError {tr("Cannot create torrent resume folder: \"%1\"")
.arg(Utils::Fs::toNativePath(m_resumeFolderPath))};
} }
} }