Merge pull request #9940 from glassez/error-msg

Show error message when Session failed to start
This commit is contained in:
Vladimir Golovnev 2018-12-09 11:16:17 +03:00 committed by GitHub
commit fc08091765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 36 deletions

View file

@ -69,6 +69,7 @@
#endif
#include "base/algorithm.h"
#include "base/exceptions.h"
#include "base/global.h"
#include "base/logger.h"
#include "base/net/downloadhandler.h"
@ -3817,11 +3818,11 @@ void Session::initResumeFolder()
if (resumeFolderDir.exists() || resumeFolderDir.mkpath(resumeFolderDir.absolutePath())) {
m_resumeFolderLock.setFileName(resumeFolderDir.absoluteFilePath("session.lock"));
if (!m_resumeFolderLock.open(QFile::WriteOnly)) {
throw std::runtime_error("Cannot write to torrent resume folder.");
throw RuntimeError {tr("Cannot write to torrent resume folder.")};
}
}
else {
throw std::runtime_error("Cannot create torrent resume folder.");
throw RuntimeError {tr("Cannot create torrent resume folder.")};
}
}