Autosave loading: suppress XML errors
This commit is contained in:
parent
e1a9d27ca6
commit
a47d126ba5
2 changed files with 6 additions and 2 deletions
src/Main
|
@ -297,9 +297,11 @@ public:
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "Unable to find -set file:" << _foundPath);
|
SG_LOG(SG_GENERAL, SG_ALERT, "Unable to find -set file:" << _foundPath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
readProperties(_foundPath, globals->get_props());
|
flightgear::SentryXMLErrorSupression xs;
|
||||||
|
readProperties(_foundPath, globals->get_props());
|
||||||
} catch ( const sg_exception &e ) {
|
} catch ( const sg_exception &e ) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT,
|
SG_LOG(SG_INPUT, SG_ALERT,
|
||||||
"Error reading aircraft: " << e.getFormattedMessage());
|
"Error reading aircraft: " << e.getFormattedMessage());
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include <Navaids/navlist.hxx>
|
#include <Navaids/navlist.hxx>
|
||||||
|
|
||||||
#include <GUI/gui.h>
|
#include <GUI/gui.h>
|
||||||
|
#include <Main/sentryIntegration.hxx>
|
||||||
#include <Viewer/viewmgr.hxx>
|
#include <Viewer/viewmgr.hxx>
|
||||||
|
|
||||||
#include <Scenery/scenery.hxx>
|
#include <Scenery/scenery.hxx>
|
||||||
|
@ -848,6 +849,7 @@ FGGlobals::loadUserSettings(SGPath userDataPath)
|
||||||
SG_LOG(SG_INPUT, SG_INFO,
|
SG_LOG(SG_INPUT, SG_INFO,
|
||||||
"Reading user settings from " << autosaveFile);
|
"Reading user settings from " << autosaveFile);
|
||||||
try {
|
try {
|
||||||
|
flightgear::SentryXMLErrorSupression xs;
|
||||||
readProperties(autosaveFile, &autosave, SGPropertyNode::USERARCHIVE);
|
readProperties(autosaveFile, &autosave, SGPropertyNode::USERARCHIVE);
|
||||||
} catch (sg_exception& e) {
|
} catch (sg_exception& e) {
|
||||||
SG_LOG(SG_INPUT, SG_WARN, "failed to read user settings:" << e.getMessage()
|
SG_LOG(SG_INPUT, SG_WARN, "failed to read user settings:" << e.getMessage()
|
||||||
|
|
Loading…
Add table
Reference in a new issue