Print a warning when encountering unknown tags in the xml spec instead of aborting with an exception. (#222)

This commit is contained in:
Markus Tavenrath 2018-06-05 11:28:31 +02:00 committed by Andreas Süßenbach
parent ea22107198
commit 3f9ca5433a

View File

@ -971,8 +971,7 @@ void checkElements(std::vector<tinyxml2::XMLElement const*> const& elements, std
std::stringstream ss;
ss << e->GetLineNum();
std::string lineNumber = ss.str();
assert(false);
throw std::runtime_error("Spec error on line " + lineNumber + ": unexpected element value <" + e->Value() + ">");
std::cerr << "Unknown element in spec on line: " << lineNumber << " " << e->Value() << std::endl;
}
}
}
@ -5094,7 +5093,7 @@ int main( int argc, char **argv )
{
std::stringstream lineNumber;
lineNumber << child->GetLineNum();
throw std::runtime_error(std::string("unknown tag ") + value + " at line number:" + lineNumber.str());
std::cerr << "Unhandled tag " << value << " at line number: " << lineNumber.str() << std::endl;
}
}