Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/lp/packet.cpp b/src/lp/packet.cpp
index 20de690..67957af 100644
--- a/src/lp/packet.cpp
+++ b/src/lp/packet.cpp
@@ -97,16 +97,16 @@
detail::FieldInfo info(element.type());
if (!info.isRecognized && !info.canIgnore) {
- throw Error("unknown field cannot be ignored");
+ BOOST_THROW_EXCEPTION(Error("unknown field cannot be ignored"));
}
if (!isFirst) {
if (info.tlvType == prev.tlvType && !info.isRepeatable) {
- throw Error("non-repeatable field cannot be repeated");
+ BOOST_THROW_EXCEPTION(Error("non-repeatable field cannot be repeated"));
}
else if (info.tlvType != prev.tlvType && !detail::compareFieldSortOrder(prev, info)) {
- throw Error("fields are not in correct sort order");
+ BOOST_THROW_EXCEPTION(Error("fields are not in correct sort order"));
}
}
@@ -126,4 +126,4 @@
}
} // namespace lp
-} // namespace ndn
\ No newline at end of file
+} // namespace ndn