1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-04 16:45:34 +00:00

Improve ESMReader error messages

This commit is contained in:
scrawl 2015-01-20 19:12:07 +01:00
parent 0fc9221eb3
commit d473629dcd
2 changed files with 10 additions and 2 deletions

View file

@ -134,7 +134,11 @@ void ESMReader::getHExact(void*p, int size)
{
getSubHeader();
if (size != static_cast<int> (mCtx.leftSub))
fail("getHExact() size mismatch");
{
std::stringstream error;
error << "getHExact(): size mismatch (requested " << size << ", got " << mCtx.leftSub << ")";
fail(error.str());
}
getExact(p, size);
}

View file

@ -137,7 +137,11 @@ public:
{
getSubHeader();
if (mCtx.leftSub != sizeof(X))
fail("getHT(): subrecord size mismatch");
{
std::stringstream error;
error << "getHT(): subrecord size mismatch (requested " << sizeof(X) << ", got " << mCtx.leftSub << ")";
fail(error.str());
}
getT(x);
}