Replace all uses of BOOST_THROW_EXCEPTION with NDN_THROW

Refs: #4834
Change-Id: I99a5c3665735f245e943506893faade3954cae5e
This commit is contained in:
Davide Pesavento committed 2020-12-23 01:05:53 -05:00
1 parent 5f408ae7f5
commit e7dc77695c
3 files changed
+10 -22

No files matched your search

+6 -4
View File
@@ -28,6 +28,7 @@
#include "bzip2-helper.hpp"
#include <ndn-cxx/util/backports.hpp>
#include <ndn-cxx/util/exception.hpp>
#include <ndn-cxx/util/string-helper.hpp>
INIT_LOGGER(Logic);
@@ -225,11 +226,12 @@ Logic::getSessionName(Name prefix)
{
if (prefix == EMPTY_NAME)
prefix = m_defaultUserPrefix;
auto node = m_nodeList.find(prefix);
if (node != m_nodeList.end())
return node->second.sessionName;
else
BOOST_THROW_EXCEPTION(Error("Refer to non-existent node:" + prefix.toUri()));
NDN_THROW(Error("Nonexistent node: " + prefix.toUri()));
}
const SeqNo&
@@ -237,12 +239,12 @@ Logic::getSeqNo(Name prefix)
{
if (prefix == EMPTY_NAME)
prefix = m_defaultUserPrefix;
auto node = m_nodeList.find(prefix);
if (node != m_nodeList.end())
return node->second.seqNo;
else
BOOST_THROW_EXCEPTION(Logic::Error("Refer to non-existent node:" + prefix.toUri()));
NDN_THROW(Error("Nonexistent node: " + prefix.toUri()));
}
void
-7
View File
@@ -31,13 +31,6 @@
#include <ndn-cxx/util/random.hpp>
#include <boost/archive/iterators/dataflow_exception.hpp>
#include <boost/archive/iterators/transform_width.hpp>
#include <boost/assert.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/throw_exception.hpp>
#include <memory>
#include <unordered_map>
namespace chronosync {
+4 -11
View File
@@ -25,18 +25,12 @@
#include "state.hpp"
#include <boost/range/adaptor/reversed.hpp>
#include <ndn-cxx/util/exception.hpp>
namespace chronosync {
State::~State() = default;
/**
* @brief Add or update leaf to the sync tree
*
* @param info session name of the leaf
* @param seq sequence number of the leaf
* @return 3-tuple (isInserted, isUpdated, oldSeqNo)
*/
std::tuple<bool, bool, SeqNo>
State::update(const Name& info, const SeqNo& seq)
{
@@ -131,11 +125,10 @@ void
State::wireDecode(const Block& wire)
{
if (!wire.hasWire())
BOOST_THROW_EXCEPTION(Error("The supplied block does not contain wire format"));
NDN_THROW(Error("The supplied block does not contain wire format"));
if (wire.type() != tlv::SyncReply)
BOOST_THROW_EXCEPTION(Error("Unexpected TLV type when decoding SyncReply: " +
boost::lexical_cast<std::string>(m_wire.type())));
NDN_THROW(Error("Unexpected TLV type when decoding SyncReply: " + ndn::to_string(wire.type())));
wire.parse();
m_wire = wire;
@@ -151,7 +144,7 @@ State::wireDecode(const Block& wire)
if (val != it->elements_end())
update(info, readNonNegativeInteger(*val));
else
BOOST_THROW_EXCEPTION(Error("No seqNo when decoding SyncReply"));
NDN_THROW(Error("No SeqNo when decoding SyncReply"));
}
}
}