Skip to content

Commit

Permalink
Tools: XMLConverter - print the reason if parsing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed May 18, 2024
1 parent 6f5336d commit 0a090af
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Tools/XMLConverter/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,12 @@ void meshToXML(const XmlOptions& opts, MeshSerializer& meshSerializer)
void XMLToBinary(const XmlOptions& opts, MeshSerializer& meshSerializer)
{
// Read root element and decide from there what type
String response;
pugi::xml_document doc;

// Some double-parsing here but never mind
if (!doc.load_file(opts.source.c_str()))
auto result = doc.load_file(opts.source.c_str());
if (!result)
{
LogManager::getSingleton().logError("Unable to load file " + opts.source);
exit (1);
OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR,
StringUtil::format("Unable to load '%s' - %s", opts.source.c_str(), result.description()));
}
pugi::xml_node root = doc.document_element();
if (StringUtil::startsWith("mesh", root.name()))
Expand Down

0 comments on commit 0a090af

Please sign in to comment.