1
0
Fork 0

Autosave loading: suppress XML errors

This commit is contained in:
James Turner 2021-04-21 21:57:32 +01:00
parent e1a9d27ca6
commit a47d126ba5
2 changed files with 6 additions and 2 deletions

View file

@ -297,9 +297,11 @@ public:
SG_LOG(SG_GENERAL, SG_ALERT, "Unable to find -set file:" << _foundPath);
return false;
}
try {
readProperties(_foundPath, globals->get_props());
flightgear::SentryXMLErrorSupression xs;
readProperties(_foundPath, globals->get_props());
} catch ( const sg_exception &e ) {
SG_LOG(SG_INPUT, SG_ALERT,
"Error reading aircraft: " << e.getFormattedMessage());

View file

@ -50,6 +50,7 @@
#include <Navaids/navlist.hxx>
#include <GUI/gui.h>
#include <Main/sentryIntegration.hxx>
#include <Viewer/viewmgr.hxx>
#include <Scenery/scenery.hxx>
@ -848,6 +849,7 @@ FGGlobals::loadUserSettings(SGPath userDataPath)
SG_LOG(SG_INPUT, SG_INFO,
"Reading user settings from " << autosaveFile);
try {
flightgear::SentryXMLErrorSupression xs;
readProperties(autosaveFile, &autosave, SGPropertyNode::USERARCHIVE);
} catch (sg_exception& e) {
SG_LOG(SG_INPUT, SG_WARN, "failed to read user settings:" << e.getMessage()