diff --git a/launcher/modManager/cmodmanager.cpp b/launcher/modManager/cmodmanager.cpp index 363cbe94d..a290ff760 100644 --- a/launcher/modManager/cmodmanager.cpp +++ b/launcher/modManager/cmodmanager.cpp @@ -26,9 +26,15 @@ namespace { QString detectModArchive(QString path, QString modName, std::vector & filesToExtract) { - ZipArchive archive(qstringToPath(path)); - - filesToExtract = archive.listFiles(); + try { + ZipArchive archive(qstringToPath(path)); + filesToExtract = archive.listFiles(); + } + catch (const std::runtime_error & e) + { + logGlobal->error("Failed to open zip archive. Reason: %s", e.what()); + return ""; + } QString modDirName; diff --git a/lib/filesystem/CZipLoader.cpp b/lib/filesystem/CZipLoader.cpp index f1f5cdf49..a3e1de6e2 100644 --- a/lib/filesystem/CZipLoader.cpp +++ b/lib/filesystem/CZipLoader.cpp @@ -191,7 +191,7 @@ ZipArchive::ZipArchive(const boost::filesystem::path & from) #endif if (archive == nullptr) - throw std::runtime_error("Failed to open file '" + from.string() + "' - unable to list files!"); + throw std::runtime_error("Failed to open file '" + from.string()); } ZipArchive::~ZipArchive()