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());
}