exceptions: Make Tlv::Error a base class for all packet-processing exceptions
This commit also includes a number of code style fixes.
Change-Id: I44f83915e733b43d5f43b4266902c8262e928d91
Refs: #1528
diff --git a/src/util/command-interest-validator.hpp b/src/util/command-interest-validator.hpp
index 07e164f..c543549 100644
--- a/src/util/command-interest-validator.hpp
+++ b/src/util/command-interest-validator.hpp
@@ -182,21 +182,21 @@
timestampIt->second = interestTime;
}
}
- catch (const Tlv::Error& e)
- {
- return onValidationFailed(interest.shared_from_this(),
- "Cannot decode signature related TLVs");
- }
- catch (const Signature::Error& e)
+ catch (Signature::Error& e)
{
return onValidationFailed(interest.shared_from_this(),
"No valid signature");
}
- catch (const IdentityCertificate::Error& e)
+ catch (IdentityCertificate::Error& e)
{
return onValidationFailed(interest.shared_from_this(),
"Cannot locate the signing key");
}
+ catch (Tlv::Error& e)
+ {
+ return onValidationFailed(interest.shared_from_this(),
+ "Cannot decode signature related TLVs");
+ }
return onValidated(interest.shared_from_this());
}
diff --git a/src/util/config-file.cpp b/src/util/config-file.cpp
index 031df25..c80ddc6 100644
--- a/src/util/config-file.cpp
+++ b/src/util/config-file.cpp
@@ -108,7 +108,7 @@
{
boost::property_tree::read_ini(m_input, m_config);
}
- catch (const boost::property_tree::ini_parser_error& error)
+ catch (boost::property_tree::ini_parser_error& error)
{
std::stringstream msg;
msg << "Failed to parse configuration file";
@@ -120,4 +120,3 @@
}
}
-
diff --git a/src/util/io.hpp b/src/util/io.hpp
index ff6852b..0bb929b 100644
--- a/src/util/io.hpp
+++ b/src/util/io.hpp
@@ -76,7 +76,7 @@
{
return shared_ptr<T>();
}
- catch (Block::Error& e)
+ catch (Tlv::Error& e)
{
return shared_ptr<T>();
}
@@ -134,7 +134,7 @@
{
throw Error(e.what());
}
- catch (Block::Error& e)
+ catch (Tlv::Error& e)
{
throw Error(e.what());
}
diff --git a/src/util/regex/regex-component-set-matcher.hpp b/src/util/regex/regex-component-set-matcher.hpp
index 5aed58f..b8c9845 100644
--- a/src/util/regex/regex-component-set-matcher.hpp
+++ b/src/util/regex/regex-component-set-matcher.hpp
@@ -15,7 +15,8 @@
namespace ndn {
-class RegexComponentSetMatcher : public RegexMatcher {
+class RegexComponentSetMatcher : public RegexMatcher
+{
public:
/**