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:
parent
0fc9221eb3
commit
d473629dcd
2 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue