Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4919aa
Refs: #2541
diff --git a/tests/daemon/face/dummy-stream-sender.hpp b/tests/daemon/face/dummy-stream-sender.hpp
index af0e114..7cbb4e2 100644
--- a/tests/daemon/face/dummy-stream-sender.hpp
+++ b/tests/daemon/face/dummy-stream-sender.hpp
@@ -67,7 +67,7 @@
{
if (error)
{
- throw Error("Connection aborted");
+ BOOST_THROW_EXCEPTION(Error("Connection aborted"));
}
// This value may need to be adjusted if some dataset exceeds 100k
@@ -88,7 +88,7 @@
onSendFinished(const boost::system::error_code& error, bool isFinal)
{
if (error) {
- throw Error("Connection aborted");
+ BOOST_THROW_EXCEPTION(Error("Connection aborted"));
}
if (isFinal) {
diff --git a/tests/daemon/mgmt/face-status-publisher-common.hpp b/tests/daemon/mgmt/face-status-publisher-common.hpp
index d785149..882c976 100644
--- a/tests/daemon/mgmt/face-status-publisher-common.hpp
+++ b/tests/daemon/mgmt/face-status-publisher-common.hpp
@@ -82,7 +82,7 @@
}
std::stringstream error;
error << "expected type " << type << " got " << block.type();
- throw tlv::Error(error.str());
+ BOOST_THROW_EXCEPTION(tlv::Error(error.str()));
}
static inline uint64_t
@@ -96,7 +96,7 @@
++i;
return readNonNegativeIntegerType(block, type);
}
- throw tlv::Error("Unexpected end of FaceStatus");
+ BOOST_THROW_EXCEPTION(tlv::Error("Unexpected end of FaceStatus"));
}
class FaceStatusPublisherFixture : public BaseFixture
diff --git a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
index cbb7280..9f9150b 100644
--- a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
+++ b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
@@ -51,7 +51,7 @@
}
std::stringstream error;
error << "Expected type " << type << " got " << block.type();
- throw tlv::Error(error.str());
+ BOOST_THROW_EXCEPTION(tlv::Error(error.str()));
}
static inline uint64_t
@@ -68,7 +68,7 @@
std::stringstream error;
error << "Unexpected end of Block while attempting to read type #"
<< type;
- throw tlv::Error(error.str());
+ BOOST_THROW_EXCEPTION(tlv::Error(error.str()));
}
class FibEnumerationPublisherFixture : public BaseFixture