add catch-rethrow for property initialization

The property doesn't know its own name, so we add it here
This commit is contained in:
v4hn 2018-02-23 16:39:58 +01:00 committed by Robert Haschke
parent 78b86bb65f
commit 30de5e1a8c

View File

@ -147,7 +147,12 @@ void PropertyMap::configureInitFrom(Property::SourceId source, const std::set<st
{ {
for (auto &pair : props_) { for (auto &pair : props_) {
if (properties.empty() || properties.count(pair.first)) if (properties.empty() || properties.count(pair.first))
try {
pair.second.configureInitFrom(source, std::bind(&fromName, std::placeholders::_1, pair.first)); pair.second.configureInitFrom(source, std::bind(&fromName, std::placeholders::_1, pair.first));
} catch (Property::error& e) {
e.setName(pair.first);
throw;
}
} }
} }