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/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 <Airports/airport.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Main/sentryIntegration.hxx>
#include <Scripting/NasalSys.hxx>
#include "AIManager.hxx"
#include "AIAircraft.hxx"
@ -211,7 +212,10 @@ SGPropertyNode_ptr FGAIManager::registerScenarioFile(SGPropertyNode_ptr root, co
auto scenariosNode = root->getNode("/sim/ai/scenarios", true);
SGPropertyNode_ptr sNode;
// don't report XML errors while loading scenarios, to Sentry
flightgear::sentryThreadReportXMLErrors(false);
try {
SGPropertyNode_ptr scenarioProps(new SGPropertyNode);
readProperties(xmlPath, scenarioProps);
@ -246,7 +250,8 @@ SGPropertyNode_ptr FGAIManager::registerScenarioFile(SGPropertyNode_ptr root, co
SG_LOG(SG_AI, SG_WARN, "Skipping malformed scenario file:" << xmlPath);
sNode.reset();
}
flightgear::sentryThreadReportXMLErrors(true);
return sNode;
}