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/security/signature-sha256-with-rsa.hpp b/src/security/signature-sha256-with-rsa.hpp
index 7e19a1e..f809709 100644
--- a/src/security/signature-sha256-with-rsa.hpp
+++ b/src/security/signature-sha256-with-rsa.hpp
@@ -15,8 +15,19 @@
/**
* Representing of SHA256-with-RSA signature in a data packet.
*/
-class SignatureSha256WithRsa : public Signature {
+class SignatureSha256WithRsa : public Signature
+{
public:
+ class Error : public Signature::Error
+ {
+ public:
+ explicit
+ Error(const std::string& what)
+ : Signature::Error(what)
+ {
+ }
+ };
+
SignatureSha256WithRsa()
{
m_info = Block(Tlv::SignatureInfo);
@@ -30,7 +41,7 @@
: Signature(signature)
{
if (getType() != Signature::Sha256WithRsa)
- throw Signature::Error("Incorrect signature type");
+ throw Error("Incorrect signature type");
m_info.parse();
Block::element_const_iterator i = m_info.find(Tlv::KeyLocator);