rib: Properly terminate when a critical error occurs
Change-Id: I0acd44d0f0bba808f8a049527708cf01a6f56eaa
Fixes: #1567
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index 3db042d..73ef71d 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -130,8 +130,7 @@
void
RibManager::setInterestFilterFailed(const Name& name, const std::string& msg)
{
- NFD_LOG_ERROR("Error in setting interest filter (" << name << "): " << msg);
- m_face.shutdown();
+ throw Error("Error in setting interest filter (" + name.toUri() + "): " + msg);
}
void
@@ -387,9 +386,10 @@
void
RibManager::onControlHeaderError(uint32_t code, const std::string& reason)
{
- NFD_LOG_ERROR("Error: couldn't enable local control header "
- << "(code: " << code << ", info: " << reason << ")");
- m_face.shutdown();
+ std::ostringstream os;
+ os << "Couldn't enable local control header "
+ << "(code: " << code << ", info: " << reason << ")";
+ throw Error(os.str());
}
void