Enhance exception throwing with Boost Exception library
Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/lp/packet.hpp b/src/lp/packet.hpp
index bf0cb01..0febb75 100644
--- a/src/lp/packet.hpp
+++ b/src/lp/packet.hpp
@@ -110,7 +110,7 @@
}
}
- throw std::out_of_range("Index out of range");
+ BOOST_THROW_EXCEPTION(std::out_of_range("Index out of range"));
}
/**
@@ -155,7 +155,7 @@
add(const typename FIELD::ValueType& value)
{
if (!FIELD::IsRepeatable::value && has<FIELD>()) {
- throw std::length_error("Field cannot be repeated");
+ BOOST_THROW_EXCEPTION(std::length_error("Field cannot be repeated"));
}
EncodingEstimator estimator;
@@ -195,7 +195,7 @@
}
}
- throw std::out_of_range("Index out of range");
+ BOOST_THROW_EXCEPTION(std::out_of_range("Index out of range"));
}
/**
@@ -221,4 +221,4 @@
} // namespace lp
} // namespace ndn
-#endif // NDN_CXX_LP_PACKET_HPP
\ No newline at end of file
+#endif // NDN_CXX_LP_PACKET_HPP