Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4919aa Refs: #2541
This commit is contained in:
+2
-1
@@ -305,7 +305,8 @@ FibUpdater::onUpdateError(const FibUpdate update,
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw Error("Non-recoverable error: " + error + " code: " + std::to_string(code));
|
||||
BOOST_THROW_EXCEPTION(Error("Non-recoverable error: " + error + " code: " +
|
||||
std::to_string(code)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ Nrd::getLocalNfdTransport()
|
||||
return make_shared<ndn::TcpTransport>("localhost", port);
|
||||
}
|
||||
else {
|
||||
throw Error("No transport is available to communicate with NFD");
|
||||
BOOST_THROW_EXCEPTION(Error("No transport is available to communicate with NFD"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,8 +90,8 @@ RemoteRegistrator::loadConfig(const ConfigSection& configSection)
|
||||
}
|
||||
else
|
||||
{
|
||||
throw ConfigFile::Error("Unrecognized option \"" + i.first +
|
||||
"\" in \"remote-registrator\" section");
|
||||
BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option \"" + i.first +
|
||||
"\" in \"remote-registrator\" section"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -167,7 +167,7 @@ RibManager::onConfig(const ConfigSection& configSection,
|
||||
m_remoteRegistrator.enable();
|
||||
}
|
||||
else {
|
||||
throw Error("Unrecognized rib property: " + item.first);
|
||||
BOOST_THROW_EXCEPTION(Error("Unrecognized rib property: " + item.first));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ RibManager::onNrdCommandPrefixAddNextHopSuccess(const Name& prefix,
|
||||
void
|
||||
RibManager::onNrdCommandPrefixAddNextHopError(const Name& name, const std::string& msg)
|
||||
{
|
||||
throw Error("Error in setting interest filter (" + name.toUri() + "): " + msg);
|
||||
BOOST_THROW_EXCEPTION(Error("Error in setting interest filter (" + name.toUri() + "): " + msg));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -586,7 +586,7 @@ RibManager::onControlHeaderError(uint32_t code, const std::string& reason)
|
||||
std::ostringstream os;
|
||||
os << "Couldn't enable local control header "
|
||||
<< "(code: " << code << ", info: " << reason << ")";
|
||||
throw Error(os.str());
|
||||
BOOST_THROW_EXCEPTION(Error(os.str()));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user