1
0
Fork 0

Check for missing file in several places

Replaces a ‘missing tag at line 1’ error with a simpler ‘file not
found’ message.

Sentry-Id: FLIGHTGEAR-5X
This commit is contained in:
James Turner 2020-10-23 14:47:59 +01:00
parent 9ebbfb90af
commit 4c3aa8b484
4 changed files with 19 additions and 0 deletions

View file

@ -484,6 +484,11 @@ void FGSubmodelMgr::setData(int id, const string& path, bool serviceable, const
SGPropertyNode root;
SGPath config = globals->resolve_aircraft_path(path);
if (!config.exists()) {
SG_LOG(SG_AI, SG_DEV_ALERT, "missing AI submodels file: " << config);
return;
}
try {
SG_LOG(SG_AI, SG_DEBUG,
"Submodels: Trying to read AI submodels file: " << config);

View file

@ -63,6 +63,11 @@ void CockpitDisplayManager::init()
}
SGPath config = globals->resolve_aircraft_path(path_n->getStringValue());
if (!config.exists()) {
SG_LOG(SG_COCKPIT, SG_DEV_ALERT, "CockpitDisplaysManager: Missing instrumentation file at:" << config);
return;
}
SG_LOG( SG_COCKPIT, SG_INFO, "Reading cockpit displays from " << config );
try {

View file

@ -73,6 +73,11 @@ void FGInstrumentMgr::init()
}
SGPath config = globals->resolve_aircraft_path(path_n->getStringValue());
if (!config.exists()) {
SG_LOG(SG_COCKPIT, SG_DEV_ALERT, "Missing instrumentation file at:" << config);
return;
}
SG_LOG( SG_COCKPIT, SG_INFO, "Reading instruments from " << config );
try {

View file

@ -36,6 +36,10 @@ FGSystemMgr::FGSystemMgr ()
if (path_n) {
SGPath config = globals->resolve_aircraft_path(path_n->getStringValue());
if (!config.exists()) {
SG_LOG( SG_SYSTEMS, SG_DEV_ALERT, "System model file not found:" << config);
return;
}
SG_LOG( SG_SYSTEMS, SG_INFO, "Reading systems from "
<< config );