1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-09 13:14:02 +02:00

A bit improved error reporting for checksum calculation.

This commit is contained in:
Ivan Savenko 2013-11-10 13:43:55 +00:00
parent 1657f124e1
commit f691061d94
3 changed files with 7 additions and 3 deletions

View File

@ -603,6 +603,7 @@ void CModHandler::loadModFilesystems()
auto filesystem = genModFilesystem(modName, fsConfig); auto filesystem = genModFilesystem(modName, fsConfig);
CResourceHandler::get()->addLoader(filesystem, false); CResourceHandler::get()->addLoader(filesystem, false);
logGlobal->traceStream() << "Generating checksum for " << modName;
ui32 newChecksum = calculateModChecksum(modName, filesystem); ui32 newChecksum = calculateModChecksum(modName, filesystem);
if (allMods[modName].checksum != newChecksum) if (allMods[modName].checksum != newChecksum)
{ {

View File

@ -46,7 +46,7 @@ CArchiveLoader::CArchiveLoader(const std::string &mountPoint, const std::string
{ {
throw std::runtime_error("LOD archive format unknown. Cannot deal with " + archive); throw std::runtime_error("LOD archive format unknown. Cannot deal with " + archive);
} }
logGlobal->traceStream() << "Archive loaded, " << entries.size() << " files found"; logGlobal->traceStream() << ext << "Archive loaded, " << entries.size() << " files found";
} }
void CArchiveLoader::initLODArchive(const std::string &mountPoint, CFileInputStream & fileStream) void CArchiveLoader::initLODArchive(const std::string &mountPoint, CFileInputStream & fileStream)
@ -179,4 +179,4 @@ std::unordered_set<ResourceID> CArchiveLoader::getFilteredFiles(std::function<bo
foundID.insert(file.first); foundID.insert(file.first);
} }
return foundID; return foundID;
} }

View File

@ -149,7 +149,10 @@ si64 CCompressedStream::readMore(ui8 *data, si64 size)
endLoop = true; endLoop = true;
break; break;
default: default:
throw std::runtime_error("Decompression error!\n"); if (inflateState->msg == nullptr)
throw std::runtime_error("Decompression error. Return code was " + boost::lexical_cast<std::string>(ret));
else
throw std::runtime_error(std::string("Decompression error: ") + inflateState->msg);
} }
} }
while (endLoop == false && inflateState->avail_out != 0 ); while (endLoop == false && inflateState->avail_out != 0 );