Skip to content

Conversation

@Addlibs
Copy link
Contributor

@Addlibs Addlibs commented Oct 16, 2018

This PR fixes #649.

Adds xmlLoadFile-style parsing error details to the resource failure reason message.

start: Resource 'res' start was requested (Couldn't parse meta file for resource 'res' [Line 4: Error reading end tag.])

The text between the brackets might be clipped to 254 characters if it's longer. This gives up to 209 characters (if the resource name is 1 character long) for parsing error message itself, which should be enough.

@botder
Copy link
Member

botder commented Oct 25, 2018

SString strReason;
metaFile->GetLastError(strReason);
m_strFailureReason = SString("Couldn't parse meta file for resource '%s' [%s]\n", m_strResourceName.c_str(), strReason.c_str());
CLogger::ErrorPrintf(m_strFailureReason);

This should do the job, unless you know how to get an empty error message.

@botder botder added the enhancement New feature or request label Oct 25, 2018
@botder botder self-assigned this Oct 30, 2018
@botder botder merged commit b7a64b4 into multitheftauto:master Oct 30, 2018
@botder botder added this to the 1.5.7 milestone Oct 30, 2018
@Addlibs Addlibs deleted the issue-#649 branch October 30, 2018 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message while loading resource coused by meta.xml should contain more datailed information

2 participants