Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4919aa
Refs: #2541
diff --git a/daemon/mgmt/general-config-section.cpp b/daemon/mgmt/general-config-section.cpp
index 4064548..ce58909 100644
--- a/daemon/mgmt/general-config-section.cpp
+++ b/daemon/mgmt/general-config-section.cpp
@@ -73,14 +73,14 @@
if (value.empty())
{
- throw ConfigFile::Error("Invalid value for \"router_name." + key + "\""
- " in \"general\" section");
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"router_name." + key + "\""
+ " in \"general\" section"));
}
}
catch (const boost::property_tree::ptree_error& error)
{
- throw ConfigFile::Error("Invalid value for \"router_name." + key + "\""
- " in \"general\" section");
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"router_name." + key + "\""
+ " in \"general\" section"));
}
return value;
@@ -129,14 +129,14 @@
if (user.empty())
{
- throw ConfigFile::Error("Invalid value for \"user\""
- " in \"general\" section");
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\""
+ " in \"general\" section"));
}
}
catch (const boost::property_tree::ptree_error& error)
{
- throw ConfigFile::Error("Invalid value for \"user\""
- " in \"general\" section");
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\""
+ " in \"general\" section"));
}
}
else if (i->first == "group")
@@ -147,14 +147,14 @@
if (group.empty())
{
- throw ConfigFile::Error("Invalid value for \"group\""
- " in \"general\" section");
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\""
+ " in \"general\" section"));
}
}
catch (const boost::property_tree::ptree_error& error)
{
- throw ConfigFile::Error("Invalid value for \"group\""
- " in \"general\" section");
+ BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\""
+ " in \"general\" section"));
}
}
}