From 81150ff6a19bfe43939c2c0e1f4a0b2583233056 Mon Sep 17 00:00:00 2001 From: Automatic Release Builder Date: Tue, 10 Nov 2020 11:32:55 +0000 Subject: [PATCH] Sentry: don't report more XML errors Don't report XML errors when parsing Nasal-loaded content, or n the launcher when scanning aircraft information. --- src/GUI/LocalAircraftCache.cxx | 3 +++ src/Main/fg_commands.cxx | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/GUI/LocalAircraftCache.cxx b/src/GUI/LocalAircraftCache.cxx index 5ac8771cc..eaf1eb72a 100644 --- a/src/GUI/LocalAircraftCache.cxx +++ b/src/GUI/LocalAircraftCache.cxx @@ -805,6 +805,8 @@ LocalAircraftCache::readAircraftProperties(const SGPath &setPath, SGPropertyNode dp->setCurrentAircraftPath(setPath); ParseSetXMLResult result = ParseSetXMLResult::Failed; + flightgear::sentryThreadReportXMLErrors(false); + try { readProperties(setPath, props); result = ParseSetXMLResult::Ok; @@ -815,6 +817,7 @@ LocalAircraftCache::readAircraftProperties(const SGPath &setPath, SGPropertyNode } rm->removeProvider(dp.get()); + flightgear::sentryThreadReportXMLErrors(true); return result; } diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index ec0fdf83c..b00f0b2d4 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -33,6 +33,7 @@ #include #include #include +#include
#include "fg_init.hxx" #include "fg_io.hxx" @@ -782,12 +783,17 @@ do_load_xml_to_proptree(const SGPropertyNode * arg, SGPropertyNode * root) else targetnode = const_cast(arg)->getNode("data", true); + // don't report Sentry errors for Nasal-loaded XML, since it makes + // for very noisy reports + flightgear::sentryThreadReportXMLErrors(false); try { readProperties(validated_path, targetnode, true); } catch (const sg_exception &e) { SG_LOG(SG_IO, quiet ? SG_DEV_WARN : SG_WARN, "loadxml exception: " << e.getFormattedMessage()); + flightgear::sentryThreadReportXMLErrors(true); return false; } + flightgear::sentryThreadReportXMLErrors(true); return true; }