1
0
Fork 0

Scenario loading: don’t report XML errors

User-defined scenarios are common, don’t report XML errors to the backend
for these since it generates a lot of noise.

Sentry-Id: FLIGHTGEAR-BNW
This commit is contained in:
James Turner 2020-12-18 15:20:13 +00:00
parent bb2ef62b5a
commit a80d273222

View file

@ -28,11 +28,12 @@
#include <simgear/structure/commands.hxx> #include <simgear/structure/commands.hxx>
#include <simgear/structure/SGBinding.hxx> #include <simgear/structure/SGBinding.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
#include <Airports/airport.hxx>
#include <Scripting/NasalSys.hxx>
#include <Add-ons/AddonManager.hxx> #include <Add-ons/AddonManager.hxx>
#include <Airports/airport.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Main/sentryIntegration.hxx>
#include <Scripting/NasalSys.hxx>
#include "AIManager.hxx" #include "AIManager.hxx"
#include "AIAircraft.hxx" #include "AIAircraft.hxx"
@ -212,6 +213,9 @@ SGPropertyNode_ptr FGAIManager::registerScenarioFile(SGPropertyNode_ptr root, co
auto scenariosNode = root->getNode("/sim/ai/scenarios", true); auto scenariosNode = root->getNode("/sim/ai/scenarios", true);
SGPropertyNode_ptr sNode; SGPropertyNode_ptr sNode;
// don't report XML errors while loading scenarios, to Sentry
flightgear::sentryThreadReportXMLErrors(false);
try { try {
SGPropertyNode_ptr scenarioProps(new SGPropertyNode); SGPropertyNode_ptr scenarioProps(new SGPropertyNode);
readProperties(xmlPath, scenarioProps); readProperties(xmlPath, scenarioProps);
@ -247,6 +251,7 @@ SGPropertyNode_ptr FGAIManager::registerScenarioFile(SGPropertyNode_ptr root, co
sNode.reset(); sNode.reset();
} }
flightgear::sentryThreadReportXMLErrors(true);
return sNode; return sNode;
} }