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:
parent
9ebbfb90af
commit
4c3aa8b484
4 changed files with 19 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Add table
Reference in a new issue