Opened 7 years ago
Closed 7 years ago
#11974 closed Bugs (fixed)
Wrong problem description in xml_archive_exception
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
xml_archive_exception::what() function returns incorrect problem description when deserialize corrupted XML file. Here is the code that thorws xml_archive_exception when some XML file is missing some required node:
try {
someConfigClass.ResetSettings();
std::ifstream ifs(ConfFileName.c_str());
assert(ifs.good());
boost::archive::xml_iarchive ia(ifs);
ia >> BOOST_SERIALIZATION_NVP(someConfigClass); <---EXCEPTION HERE
ifs.close();
} catch(boost::archive::xml_archive_exception& e) {
logger.Write(Logger::EError, e.what()); <--HERE THE DESCRIPTION IS RETURNED
return false;
}
In 1.52 version the xml_archive_exception::what() returned the following:
XML start/end tag mismatch – SOME_MISSING_XML_ELEMENT
In 1.57 version xml_archive_exception::what() returns this:
SOME_MISSING_XML_ELEMENT
The mentioned code has noot been modified for a long time. But the version of boost has been changed. After that our test team noticed the error. Unfortunately i did not test it on last version.
OK - found this and fixed it - should show up in 1.61 release