Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/data.cpp b/src/data.cpp
index 9e5effe..f96fb8f 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -63,7 +63,7 @@
if (!unsignedPortion && !m_signature)
{
- throw Error("Requested wire format, but data packet has not been signed yet");
+ BOOST_THROW_EXCEPTION(Error("Requested wire format, but data packet has not been signed yet"));
}
if (!unsignedPortion)
@@ -180,8 +180,8 @@
{
if (m_fullName.empty()) {
if (!m_wire.hasWire()) {
- throw Error("Full name requested, but Data packet does not have wire format "
- "(e.g., not signed)");
+ BOOST_THROW_EXCEPTION(Error("Full name requested, but Data packet does not have wire format "
+ "(e.g., not signed)"));
}
m_fullName = m_name;
m_fullName.appendImplicitSha256Digest(crypto::sha256(m_wire.wire(), m_wire.size()));