From 1583ad3b03bdfb0ce30e055dbe3c9874363a2990 Mon Sep 17 00:00:00 2001 From: Automatic Release Builder Date: Tue, 10 Nov 2020 22:37:20 +0000 Subject: [PATCH] =?UTF-8?q?FlightPlans:=20don=E2=80=99t=20report=20XML=20e?= =?UTF-8?q?rrors=20on=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assume FlightPlan content might be user sourced; don’t worry about reporting errors for it. --- src/Navaids/FlightPlan.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Navaids/FlightPlan.cxx b/src/Navaids/FlightPlan.cxx index 06be225df..857cfc09a 100644 --- a/src/Navaids/FlightPlan.cxx +++ b/src/Navaids/FlightPlan.cxx @@ -48,6 +48,7 @@ #include #include #include +#include
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 {