Commit 07d1df53 authored by Micha Mueller's avatar Micha Mueller
Browse files

Add error message if input from config file is unknown

parent 56c77a58
......@@ -101,7 +101,6 @@ public:
//read groups and templates for groups. If present also entity/-template stuff
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, cfg) {
//TODO allow single sensors for convenience?
//template entity
if (boost::iequals(val.first, "template_" + _entityName)) {
LOG(debug) << "Template " << _entityName << " \"" << val.second.data() << "\"";
......@@ -232,6 +231,9 @@ public:
delete group;
}
}
} else {
LOG(error) << "\"" << val.first << "\": unknown construct!";
return false;
}
}
//read of config finished. Now we build the mqtt-topic for every sensor
......
......@@ -175,7 +175,10 @@ bool PerfeventConfigurator::readConfig(std::string cfgPath) {
LOG(warning) << _groupName << " \"" << val.second.data() << "\" has bad values! Ignoring...";
}
}
}
} else {
LOG(error) << "\"" << val.first << "\": unknown construct!";
return false;
}
}
//read of config finished. Now we build the mqtt-topic for every sensor
for(auto g : _sensorGroups) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment