Input-device configuration: report config errors
This commit is contained in:
parent
fba1e9fa61
commit
a1b5f452e3
1 changed files with 9 additions and 7 deletions
|
@ -97,13 +97,16 @@ FGDeviceConfigurationMap::configurationForDeviceName(const std::string& name)
|
||||||
|
|
||||||
SGPropertyNode_ptr result(new SGPropertyNode);
|
SGPropertyNode_ptr result(new SGPropertyNode);
|
||||||
try {
|
try {
|
||||||
readProperties(it->second, result);
|
flightgear::SentryXMLErrorSupression xs;
|
||||||
result->setStringValue("source", it->second.utf8Str());
|
readProperties(it->second, result);
|
||||||
} catch (sg_exception&) {
|
result->setStringValue("source", it->second.utf8Str());
|
||||||
SG_LOG(SG_INPUT, SG_WARN, "parse failure reading:" << it->second);
|
} catch (sg_exception& e) {
|
||||||
return {};
|
simgear::reportFailure(simgear::LoadFailure::BadData, simgear::ErrorCode::InputDeviceConfig,
|
||||||
|
"Failed to parse device configuration:" + e.getFormattedMessage(),
|
||||||
|
it->second);
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +171,6 @@ void FGDeviceConfigurationMap::refreshCacheForFile(const SGPath& path)
|
||||||
try {
|
try {
|
||||||
readProperties(path, n);
|
readProperties(path, n);
|
||||||
} catch (sg_exception& e) {
|
} catch (sg_exception& e) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "parse failure reading:" << path);
|
|
||||||
simgear::reportFailure(simgear::LoadFailure::BadData, simgear::ErrorCode::InputDeviceConfig,
|
simgear::reportFailure(simgear::LoadFailure::BadData, simgear::ErrorCode::InputDeviceConfig,
|
||||||
"Failed to load input device configuration:" + e.getFormattedMessage(),
|
"Failed to load input device configuration:" + e.getFormattedMessage(),
|
||||||
path);
|
path);
|
||||||
|
|
Loading…
Add table
Reference in a new issue