1
0
Fork 0

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.
This commit is contained in:
Automatic Release Builder 2020-11-10 11:32:55 +00:00 committed by James Turner
parent be50f64821
commit 81150ff6a1
2 changed files with 9 additions and 0 deletions

View file

@ -805,6 +805,8 @@ LocalAircraftCache::readAircraftProperties(const SGPath &setPath, SGPropertyNode
dp->setCurrentAircraftPath(setPath); dp->setCurrentAircraftPath(setPath);
ParseSetXMLResult result = ParseSetXMLResult::Failed; ParseSetXMLResult result = ParseSetXMLResult::Failed;
flightgear::sentryThreadReportXMLErrors(false);
try { try {
readProperties(setPath, props); readProperties(setPath, props);
result = ParseSetXMLResult::Ok; result = ParseSetXMLResult::Ok;
@ -815,6 +817,7 @@ LocalAircraftCache::readAircraftProperties(const SGPath &setPath, SGPropertyNode
} }
rm->removeProvider(dp.get()); rm->removeProvider(dp.get());
flightgear::sentryThreadReportXMLErrors(true);
return result; return result;
} }

View file

@ -33,6 +33,7 @@
#include <Environment/presets.hxx> #include <Environment/presets.hxx>
#include <Navaids/NavDataCache.hxx> #include <Navaids/NavDataCache.hxx>
#include <GUI/gui.h> #include <GUI/gui.h>
#include <Main/sentryIntegration.hxx>
#include "fg_init.hxx" #include "fg_init.hxx"
#include "fg_io.hxx" #include "fg_io.hxx"
@ -782,12 +783,17 @@ do_load_xml_to_proptree(const SGPropertyNode * arg, SGPropertyNode * root)
else else
targetnode = const_cast<SGPropertyNode *>(arg)->getNode("data", true); targetnode = const_cast<SGPropertyNode *>(arg)->getNode("data", true);
// don't report Sentry errors for Nasal-loaded XML, since it makes
// for very noisy reports
flightgear::sentryThreadReportXMLErrors(false);
try { try {
readProperties(validated_path, targetnode, true); readProperties(validated_path, targetnode, true);
} catch (const sg_exception &e) { } catch (const sg_exception &e) {
SG_LOG(SG_IO, quiet ? SG_DEV_WARN : SG_WARN, "loadxml exception: " << e.getFormattedMessage()); SG_LOG(SG_IO, quiet ? SG_DEV_WARN : SG_WARN, "loadxml exception: " << e.getFormattedMessage());
flightgear::sentryThreadReportXMLErrors(true);
return false; return false;
} }
flightgear::sentryThreadReportXMLErrors(true);
return true; return true;
} }