1
0
Fork 0

Catch XML errors parsing traffic files

Sentry-Id: FLIGHTGEAR-EQ
This commit is contained in:
James Turner 2020-10-24 15:48:57 +01:00
parent fd630b6d37
commit 358fb70ee0

View file

@ -382,10 +382,14 @@ private:
SG_LOG(SG_AI, SG_DEBUG, "parsing traffic in:" << p);
simgear::PathList trafficFiles = d2.children(simgear::Dir::TYPE_FILE, ".xml");
for (const auto& xml : trafficFiles) {
try {
readXML(xml, *this);
if (_cancelThread) {
return;
}
} catch (sg_exception& e) {
SG_LOG(SG_AI, SG_WARN, "XML error parsing traffic file:" << xml << "\n\t" << e.getFormattedMessage());
}
}
} // of sub-directories iteration