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); SG_LOG(SG_AI, SG_DEBUG, "parsing traffic in:" << p);
simgear::PathList trafficFiles = d2.children(simgear::Dir::TYPE_FILE, ".xml"); simgear::PathList trafficFiles = d2.children(simgear::Dir::TYPE_FILE, ".xml");
for (const auto& xml : trafficFiles) { for (const auto& xml : trafficFiles) {
try {
readXML(xml, *this); readXML(xml, *this);
if (_cancelThread) { if (_cancelThread) {
return; 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 } // of sub-directories iteration