Skip to content

Commit b7a64b4

Browse files
Addlibsbotder
authored andcommitted
Added error message for resource meta.xml parsing failure (#655, fixes #649)
1 parent 84e8e10 commit b7a64b4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Server/mods/deathmatch/logic/CResource.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,15 @@ bool CResource::Load(void)
358358
}
359359
else
360360
{
361-
char szBuffer[255] = {0};
362-
snprintf(szBuffer, 254, "Couldn't parse meta file for resource '%s'\n", m_strResourceName.c_str());
363-
m_strFailureReason = szBuffer;
364-
CLogger::ErrorPrintf(szBuffer);
361+
SString strError;
362+
metaFile->GetLastError(strError);
363+
364+
if (strError.empty())
365+
m_strFailureReason = SString("Couldn't parse meta file for resource '%s'\n", m_strResourceName.c_str());
366+
else
367+
m_strFailureReason = SString("Couldn't parse meta file for resource '%s' [%s]\n", m_strResourceName.c_str(), strError.c_str());
368+
369+
CLogger::ErrorPrintf(m_strFailureReason.c_str());
365370

366371
// Delete the XML file if we somehow got to load it halfway
367372
if (metaFile)

0 commit comments

Comments
 (0)