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:
parent
bedcc81d98
commit
1583ad3b03
1 changed files with 7 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue