1
0
Fork 0

FlightPlans: don’t report XML errors on load

Assume FlightPlan content might be user sourced; don’t worry about
reporting errors for it.
This commit is contained in:
Automatic Release Builder 2020-11-10 22:37:20 +00:00 committed by James Turner
parent bedcc81d98
commit 1583ad3b03

View file

@ -48,6 +48,7 @@
#include <Navaids/airways.hxx>
#include <Autopilot/route_mgr.hxx>
#include <Aircraft/AircraftPerformance.hxx>
#include <Main/sentryIntegration.hxx>
using std::string;
using std::vector;
@ -1068,15 +1069,21 @@ bool FlightPlan::loadGpxFormat(const SGPath& path)
bool FlightPlan::loadXmlFormat(const SGPath& path)
{
SGPropertyNode_ptr routeData(new SGPropertyNode);
// avoid error reports on user flight-plans
flightgear::sentryThreadReportXMLErrors(false);
try {
readProperties(path, routeData);
} catch (sg_exception& e) {
SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << e.getOrigin()
<< "'. " << e.getMessage());
// XML parsing fails => not a property XML file
flightgear::sentryThreadReportXMLErrors(true);
return false;
}
flightgear::sentryThreadReportXMLErrors(true);
if (routeData.valid())
{
try {