Move PropertyNotFound handling to ProgOptions

This commit is contained in:
Alexey Rybalchenko
2019-07-11 17:55:17 +02:00
committed by Dennis Klein
parent 48e04b636b
commit 26fe5e2bd8
4 changed files with 50 additions and 26 deletions

View File

@@ -197,6 +197,17 @@ string ProgOptions::GetPropertyAsString(const string& key) const
{
lock_guard<mutex> lock(fMtx);
if (fVarMap.count(key)) {
return ConvertVarValToString(fVarMap.at(key));
} else {
throw PropertyNotFoundError(fair::mq::tools::ToString("Config has no key: ", key));
}
}
string ProgOptions::GetStringValue(const string& key) const
{
lock_guard<mutex> lock(fMtx);
if (fVarMap.count(key)) {
return ConvertVarValToString(fVarMap.at(key));
} else {