Replace all uses of BOOST_THROW_EXCEPTION with NDN_THROW
Refs: #4834
Change-Id: If2455e1830f310beea434ffb455d960e11c4c2ed
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index 691b40b..21949b3 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -89,7 +89,7 @@
m_socket.assign(m_pcap.getFd());
}
catch (const PcapHelper::Error& e) {
- BOOST_THROW_EXCEPTION(Error(e.what()));
+ NDN_THROW_NESTED(Error(e.what()));
}
updateFilter();
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 7603343..4d4d295 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -96,12 +96,12 @@
const std::string& valueStr = value.get_value<std::string>();
mcastConfig.group = ethernet::Address::fromString(valueStr);
if (mcastConfig.group.isNull()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("face_system.ether.mcast_group: '" +
- valueStr + "' cannot be parsed as an Ethernet address"));
+ NDN_THROW(ConfigFile::Error("face_system.ether.mcast_group: '" +
+ valueStr + "' cannot be parsed as an Ethernet address"));
}
else if (!mcastConfig.group.isMulticast()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("face_system.ether.mcast_group: '" +
- valueStr + "' is not a multicast address"));
+ NDN_THROW(ConfigFile::Error("face_system.ether.mcast_group: '" +
+ valueStr + "' is not a multicast address"));
}
}
else if (key == "mcast_ad_hoc") {
@@ -115,7 +115,7 @@
mcastConfig.netifPredicate.parseBlacklist(value);
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.ether." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.ether." + key));
}
}
}
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index 412bcba..ee7193b 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -55,7 +55,7 @@
m_socket.assign(m_pcap.getFd());
}
catch (const PcapHelper::Error& e) {
- BOOST_THROW_EXCEPTION(Error(e.what()));
+ NDN_THROW_NESTED(Error(e.what()));
}
m_netifStateConn = localEndpoint.onStateChanged.connect(
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index 79880da..21685f3 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -110,7 +110,7 @@
context.generalConfig.wantCongestionMarking = ConfigFile::parseYesNo(pair, "face_system.general");
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.general." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.general." + key));
}
}
}
@@ -150,7 +150,7 @@
// const ConfigSection& subSection = pair.second;
if (!seenSections.insert(sectionName).second) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Duplicate section face_system." + sectionName));
+ NDN_THROW(ConfigFile::Error("Duplicate section face_system." + sectionName));
}
if (sectionName == SECTION_GENERAL || sectionName == SECTION_NETDEVBOUND ||
@@ -158,7 +158,7 @@
continue;
}
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system." + sectionName));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system." + sectionName));
}
}
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index 7b248fb..d46356b 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -188,7 +188,7 @@
lp::Sequence txSeq = ++m_lastTxSeqNo;
frag.set<lp::TxSequenceField>(txSeq);
if (m_unackedFrags.size() > 0 && m_lastTxSeqNo == m_firstUnackedFrag->first) {
- BOOST_THROW_EXCEPTION(std::length_error("TxSequence range exceeded"));
+ NDN_THROW(std::length_error("TxSequence range exceeded"));
}
return m_lastTxSeqNo;
}
diff --git a/daemon/face/multicast-ethernet-transport.cpp b/daemon/face/multicast-ethernet-transport.cpp
index 91c25d4..2afb793 100644
--- a/daemon/face/multicast-ethernet-transport.cpp
+++ b/daemon/face/multicast-ethernet-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -144,7 +144,7 @@
NFD_LOG_FACE_WARN("ioctl(SIOCADDMULTI) failed: " << std::strerror(errno));
#endif
- BOOST_THROW_EXCEPTION(Error("Failed to join multicast group"));
+ NDN_THROW(Error("Failed to join multicast group"));
}
} // namespace face
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index db12128..6e99a1c 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -124,8 +124,7 @@
#if defined(__linux__) && !defined(__ANDROID__)
PrivilegeHelper::runElevated([=] {
if (::setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname.data(), ifname.size() + 1) < 0) {
- BOOST_THROW_EXCEPTION(MulticastUdpTransport::Error("Cannot bind multicast rx socket to " +
- ifname + ": " + std::strerror(errno)));
+ NDN_THROW_ERRNO(MulticastUdpTransport::Error("Cannot bind multicast rx socket to " + ifname));
}
});
#endif
diff --git a/daemon/face/netdev-bound.cpp b/daemon/face/netdev-bound.cpp
index a47bd43..5ed975d 100644
--- a/daemon/face/netdev-bound.cpp
+++ b/daemon/face/netdev-bound.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -53,8 +53,7 @@
rules.push_back(parseRule(ruleIndex++, value));
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "Unrecognized option face_system.netdev_bound." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.netdev_bound." + key));
}
}
}
@@ -70,8 +69,8 @@
for (const FaceUri& remote : rule.remotes) {
std::string devScheme = remote.getScheme() + "+dev";
if (!m_faceSystem.hasFactoryForScheme(devScheme)) {
- BOOST_THROW_EXCEPTION(RuleParseError(
- i, "scheme " + devScheme + " for " + remote.toString() + " is unavailable"));
+ NDN_THROW(RuleParseError(i, "scheme '" + devScheme + "' for " +
+ remote.toString() + " is unavailable"));
}
}
}
@@ -102,44 +101,44 @@
try {
rule.remotes.emplace_back(value.get_value<std::string>());
}
- catch (const FaceUri::Error& ex) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "invalid remote FaceUri", ex.what()));
+ catch (const FaceUri::Error&) {
+ NDN_THROW_NESTED(RuleParseError(index, "invalid remote FaceUri"));
}
if (!rule.remotes.back().isCanonical()) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "remote FaceUri is not canonical"));
+ NDN_THROW(RuleParseError(index, "remote FaceUri is not canonical"));
}
}
else if (key == "whitelist") {
if (hasWhitelist) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "duplicate whitelist"));
+ NDN_THROW(RuleParseError(index, "duplicate whitelist"));
}
try {
rule.netifPredicate.parseWhitelist(value);
}
- catch (const ConfigFile::Error& ex) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "invalid whitelist", ex.what()));
+ catch (const ConfigFile::Error&) {
+ NDN_THROW_NESTED(RuleParseError(index, "invalid whitelist"));
}
hasWhitelist = true;
}
else if (key == "blacklist") {
if (hasBlacklist) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "duplicate blacklist"));
+ NDN_THROW(RuleParseError(index, "duplicate blacklist"));
}
try {
rule.netifPredicate.parseBlacklist(value);
}
- catch (const ConfigFile::Error& ex) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "invalid blacklist", ex.what()));
+ catch (const ConfigFile::Error&) {
+ NDN_THROW_NESTED(RuleParseError(index, "invalid blacklist"));
}
hasBlacklist = true;
}
else {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "unrecognized option " + key));
+ NDN_THROW(RuleParseError(index, "unrecognized option " + key));
}
}
if (rule.remotes.empty()) {
- BOOST_THROW_EXCEPTION(RuleParseError(index, "remote FaceUri is missing"));
+ NDN_THROW(RuleParseError(index, "remote FaceUri is missing"));
}
///\todo #3521 for each remote, check that there is a factory providing scheme+dev scheme
diff --git a/daemon/face/netdev-bound.hpp b/daemon/face/netdev-bound.hpp
index 17a6ce8..6297afd 100644
--- a/daemon/face/netdev-bound.hpp
+++ b/daemon/face/netdev-bound.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,11 +48,6 @@
{
}
- RuleParseError(int index, std::string msg, const char* innerMsg)
- : RuleParseError(index, msg + " - " + innerMsg)
- {
- }
-
public:
int index;
std::string msg;
diff --git a/daemon/face/pcap-helper.cpp b/daemon/face/pcap-helper.cpp
index 072f75e..4b474e6 100644
--- a/daemon/face/pcap-helper.cpp
+++ b/daemon/face/pcap-helper.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,14 +41,14 @@
char errbuf[PCAP_ERRBUF_SIZE] = {};
m_pcap = pcap_create(interfaceName.data(), errbuf);
if (!m_pcap)
- BOOST_THROW_EXCEPTION(Error("pcap_create: " + std::string(errbuf)));
+ NDN_THROW(Error("pcap_create: " + std::string(errbuf)));
// Enable "immediate mode", effectively disabling any read buffering in the kernel.
// This corresponds to the BIOCIMMEDIATE ioctl on BSD-like systems (including macOS)
// where libpcap uses a BPF device. On Linux this forces libpcap not to use TPACKET_V3,
// even if the kernel supports it, thus preventing bug #1511.
if (pcap_set_immediate_mode(m_pcap, 1) < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_set_immediate_mode failed"));
+ NDN_THROW(Error("pcap_set_immediate_mode failed"));
}
PcapHelper::~PcapHelper()
@@ -61,13 +61,13 @@
{
int ret = pcap_activate(m_pcap);
if (ret < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_activate: " + std::string(pcap_statustostr(ret))));
+ NDN_THROW(Error("pcap_activate: " + std::string(pcap_statustostr(ret))));
if (pcap_set_datalink(m_pcap, dlt) < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_set_datalink: " + getLastError()));
+ NDN_THROW(Error("pcap_set_datalink: " + getLastError()));
if (pcap_setdirection(m_pcap, PCAP_D_IN) < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_setdirection: " + getLastError()));
+ NDN_THROW(Error("pcap_setdirection: " + getLastError()));
}
void
@@ -84,7 +84,7 @@
{
int fd = pcap_get_selectable_fd(m_pcap);
if (fd < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_get_selectable_fd failed"));
+ NDN_THROW(Error("pcap_get_selectable_fd failed"));
// we need to duplicate the fd, otherwise both pcap_close() and the
// caller may attempt to close the same fd and one of them will fail
@@ -102,7 +102,7 @@
{
pcap_stat ps{};
if (pcap_stats(m_pcap, &ps) < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_stats: " + getLastError()));
+ NDN_THROW(Error("pcap_stats: " + getLastError()));
return ps.ps_drop;
}
@@ -112,12 +112,12 @@
{
bpf_program prog;
if (pcap_compile(m_pcap, &prog, filter, 1, PCAP_NETMASK_UNKNOWN) < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_compile: " + getLastError()));
+ NDN_THROW(Error("pcap_compile: " + getLastError()));
int ret = pcap_setfilter(m_pcap, &prog);
pcap_freecode(&prog);
if (ret < 0)
- BOOST_THROW_EXCEPTION(Error("pcap_setfilter: " + getLastError()));
+ NDN_THROW(Error("pcap_setfilter: " + getLastError()));
}
std::tuple<const uint8_t*, size_t, std::string>
diff --git a/daemon/face/protocol-factory.cpp b/daemon/face/protocol-factory.cpp
index cdb6cb1..5acb18f 100644
--- a/daemon/face/protocol-factory.cpp
+++ b/daemon/face/protocol-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -114,7 +114,7 @@
ProtocolFactory::doCreateNetdevBoundFace(const FaceUri&,
const shared_ptr<const ndn::net::NetworkInterface>&)
{
- BOOST_THROW_EXCEPTION(Error("This protocol factory does not support netdev-bound faces"));
+ NDN_THROW(Error("This protocol factory does not support netdev-bound faces"));
}
std::vector<shared_ptr<const Channel>>
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index d77b639..f45d786 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -94,12 +94,12 @@
local.parseBlacklist(localPair.second);
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.tcp.local." + localKey));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.tcp.local." + localKey));
}
}
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.tcp." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.tcp." + key));
}
}
if (!isLocalConfigured) {
@@ -107,7 +107,7 @@
}
if (!enableV4 && !enableV6) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
+ NDN_THROW(ConfigFile::Error(
"IPv4 and IPv6 TCP channels have been disabled. Remove face_system.tcp section to disable "
"TCP channels or enable at least one channel type."));
}
diff --git a/daemon/face/transport.cpp b/daemon/face/transport.cpp
index c08990a..e93480f 100644
--- a/daemon/face/transport.cpp
+++ b/daemon/face/transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -201,7 +201,7 @@
}
if (!isValid) {
- BOOST_THROW_EXCEPTION(std::runtime_error("invalid state transition"));
+ NDN_THROW(std::runtime_error("Invalid state transition"));
}
NFD_LOG_FACE_INFO("setState " << m_state << " -> " << newState);
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 6c261fb..6730389 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -124,12 +124,12 @@
boost::system::error_code ec;
mcastConfig.group.address(ip::address_v4::from_string(valueStr, ec));
if (ec) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("face_system.udp.mcast_group: '" +
- valueStr + "' cannot be parsed as an IPv4 address"));
+ NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group: '" +
+ valueStr + "' cannot be parsed as an IPv4 address"));
}
else if (!mcastConfig.group.address().is_multicast()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("face_system.udp.mcast_group: '" +
- valueStr + "' is not a multicast address"));
+ NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group: '" +
+ valueStr + "' is not a multicast address"));
}
}
else if (key == "mcast_port") {
@@ -140,12 +140,12 @@
boost::system::error_code ec;
mcastConfig.groupV6.address(ip::address_v6::from_string(valueStr, ec));
if (ec) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("face_system.udp.mcast_group_v6: '" +
- valueStr + "' cannot be parsed as an IPv6 address"));
+ NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group_v6: '" +
+ valueStr + "' cannot be parsed as an IPv6 address"));
}
else if (!mcastConfig.groupV6.address().is_multicast()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("face_system.udp.mcast_group_v6: '" +
- valueStr + "' is not a multicast address"));
+ NDN_THROW(ConfigFile::Error("face_system.udp.mcast_group_v6: '" +
+ valueStr + "' is not a multicast address"));
}
}
else if (key == "mcast_port_v6") {
@@ -162,12 +162,12 @@
mcastConfig.netifPredicate.parseBlacklist(value);
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.udp." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.udp." + key));
}
}
if (!enableV4 && !enableV6 && !mcastConfig.isEnabled) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
+ NDN_THROW(ConfigFile::Error(
"IPv4 and IPv6 UDP channels and UDP multicast have been disabled. "
"Remove face_system.udp section to disable UDP channels or enable at least one of them."));
}
@@ -298,9 +298,8 @@
// check if the endpoint is already used by a multicast face
if (m_mcastFaces.find(localEndpoint) != m_mcastFaces.end()) {
- BOOST_THROW_EXCEPTION(Error("Cannot create UDP channel on " +
- boost::lexical_cast<std::string>(localEndpoint) +
- ", endpoint already allocated for a UDP multicast face"));
+ NDN_THROW(Error("Cannot create UDP channel on " + boost::lexical_cast<std::string>(localEndpoint) +
+ ", endpoint already allocated to a UDP multicast face"));
}
auto channel = std::make_shared<UdpChannel>(localEndpoint, idleTimeout, m_wantCongestionMarking);
@@ -338,16 +337,14 @@
if (it->second->getRemoteUri() == FaceUri(mcastEp))
return it->second;
else
- BOOST_THROW_EXCEPTION(Error("Cannot create UDP multicast face on " +
- boost::lexical_cast<std::string>(localEp) +
- ", endpoint already allocated for a different UDP multicast face"));
+ NDN_THROW(Error("Cannot create UDP multicast face on " + boost::lexical_cast<std::string>(localEp) +
+ ", endpoint already allocated to a different UDP multicast face"));
}
// check if the local endpoint is already used by a unicast channel
if (m_channels.find(localEp) != m_channels.end()) {
- BOOST_THROW_EXCEPTION(Error("Cannot create UDP multicast face on " +
- boost::lexical_cast<std::string>(localEp) +
- ", endpoint already allocated for a UDP channel"));
+ NDN_THROW(Error("Cannot create UDP multicast face on " + boost::lexical_cast<std::string>(localEp) +
+ ", endpoint already allocated to a UDP channel"));
}
ip::udp::socket rxSock(getGlobalIoService());
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index 8c58c55..172f797 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -82,8 +82,7 @@
NFD_LOG_CHAN_TRACE("connect() on existing socket file returned: " << error.message());
if (!error) {
// someone answered, leave the socket alone
- BOOST_THROW_EXCEPTION(Error("Socket file at " + m_endpoint.path()
- + " belongs to another NFD process"));
+ NDN_THROW(Error("Socket file at " + m_endpoint.path() + " belongs to another NFD process"));
}
else if (error == boost::asio::error::connection_refused ||
error == boost::asio::error::timed_out) {
@@ -94,7 +93,7 @@
}
}
else if (type != fs::file_not_found) {
- BOOST_THROW_EXCEPTION(Error(m_endpoint.path() + " already exists and is not a socket file"));
+ NDN_THROW(Error(m_endpoint.path() + " already exists and is not a socket file"));
}
m_acceptor.open();
@@ -102,7 +101,7 @@
m_acceptor.listen(backlog);
if (::chmod(m_endpoint.path().data(), 0666) < 0) {
- BOOST_THROW_EXCEPTION(Error("chmod(" + m_endpoint.path() + ") failed: " + std::strerror(errno)));
+ NDN_THROW_ERRNO(Error("Failed to chmod " + m_endpoint.path()));
}
accept(onFaceCreated, onAcceptFailed);
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index 211203a..faa406c 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -68,7 +68,7 @@
path = value.get_value<std::string>();
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.unix." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.unix." + key));
}
}
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index e3d8d57..49e5740 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -75,13 +75,13 @@
enableV6 = ConfigFile::parseYesNo(pair, "face_system.websocket");
}
else {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Unrecognized option face_system.websocket." + key));
+ NDN_THROW(ConfigFile::Error("Unrecognized option face_system.websocket." + key));
}
}
}
if (!enableV4 && !enableV6) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
+ NDN_THROW(ConfigFile::Error(
"IPv4 and IPv6 WebSocket channels have been disabled. Remove face_system.websocket section "
"to disable WebSocket channels or enable at least one channel type."));
}
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 31e2b91..13560a9 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -39,10 +39,10 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("AccessStrategy does not accept parameters"));
+ NDN_THROW(std::invalid_argument("AccessStrategy does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"AccessStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index f743e06..6302020 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -85,7 +85,7 @@
m_lastInterestName = interestName;
}
else {
- BOOST_THROW_EXCEPTION(FaceInfo::Error("Tried to schedule a timeout for a face that already has a timeout scheduled."));
+ NDN_THROW(FaceInfo::Error("Tried to schedule a timeout for a face that already has a timeout scheduled"));
}
}
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index 8a81a77..dd2b537 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -197,9 +197,8 @@
m_probingInterval = time::milliseconds(probingInterval);
}
else {
- BOOST_THROW_EXCEPTION(std::invalid_argument("Probing interval should be >= "
- + to_string(MIN_PROBING_INTERVAL.count())
- + " milliseconds"));
+ NDN_THROW(std::invalid_argument("Probing interval should be >= " +
+ to_string(MIN_PROBING_INTERVAL.count()) + " milliseconds"));
}
}
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index d47649d..67d6944 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -52,7 +52,7 @@
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"AsfStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
@@ -75,7 +75,7 @@
std::string parsedStr(reinterpret_cast<const char*>(component.value()), component.value_size());
auto n = parsedStr.find("~");
if (n == std::string::npos) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("Format is <parameter>~<value>"));
+ NDN_THROW(std::invalid_argument("Format is <parameter>~<value>"));
}
auto f = parsedStr.substr(0, n);
@@ -87,7 +87,7 @@
m_maxSilentTimeouts = getParamValue(f, s);
}
else {
- BOOST_THROW_EXCEPTION(std::invalid_argument("Parameter should be probing-interval or n-silent-timeouts"));
+ NDN_THROW(std::invalid_argument("Parameter should be probing-interval or n-silent-timeouts"));
}
}
}
@@ -97,12 +97,12 @@
{
try {
if (!value.empty() && value[0] == '-')
- BOOST_THROW_EXCEPTION(boost::bad_lexical_cast());
+ NDN_THROW(boost::bad_lexical_cast());
return boost::lexical_cast<uint64_t>(value);
}
catch (const boost::bad_lexical_cast&) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("Value of " + param + " must be a non-negative integer"));
+ NDN_THROW(std::invalid_argument("Value of " + param + " must be a non-negative integer"));
}
}
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index e4462e4..dbf410b 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -63,10 +63,10 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("BestRouteStrategy does not accept parameters"));
+ NDN_THROW(std::invalid_argument("BestRouteStrategy does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"BestRouteStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index 0ab6b25..03f27dc 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -45,10 +45,10 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("BestRouteStrategy2 does not accept parameters"));
+ NDN_THROW(std::invalid_argument("BestRouteStrategy2 does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"BestRouteStrategy2 does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index 6a05356..71fa7c1 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -46,10 +46,10 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("MulticastStrategy does not accept parameters"));
+ NDN_THROW(std::invalid_argument("MulticastStrategy does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"MulticastStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index df9a41b..9a16897 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -42,10 +42,10 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("NccStrategy does not accept parameters"));
+ NDN_THROW(std::invalid_argument("NccStrategy does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"NccStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index 5a43a26..174dca4 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -49,10 +49,10 @@
{
ParsedInstanceName parsed = parseInstanceName(name);
if (!parsed.parameters.empty()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("SelfLearningStrategy does not accept parameters"));
+ NDN_THROW(std::invalid_argument("SelfLearningStrategy does not accept parameters"));
}
if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
- BOOST_THROW_EXCEPTION(std::invalid_argument(
+ NDN_THROW(std::invalid_argument(
"SelfLearningStrategy does not support version " + to_string(*parsed.version)));
}
this->setInstanceName(makeInstanceName(name, getStrategyName()));
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index 0b6346b..913c74f 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -124,14 +124,13 @@
}
if (section.empty()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("'authorize' is missing under 'authorizations'"));
+ NDN_THROW(ConfigFile::Error("'authorize' is missing under 'authorizations'"));
}
int authSectionIndex = 0;
for (const auto& kv : section) {
if (kv.first != "authorize") {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "'" + kv.first + "' section is not permitted under 'authorizations'"));
+ NDN_THROW(ConfigFile::Error("'" + kv.first + "' section is not permitted under 'authorizations'"));
}
const ConfigSection& authSection = kv.second;
@@ -140,8 +139,8 @@
certfile = authSection.get<std::string>("certfile");
}
catch (const boost::property_tree::ptree_error&) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "'certfile' is missing under authorize[" + to_string(authSectionIndex) + "]"));
+ NDN_THROW(ConfigFile::Error("'certfile' is missing under authorize[" +
+ to_string(authSectionIndex) + "]"));
}
bool isAny = false;
@@ -156,9 +155,8 @@
path certfilePath = absolute(certfile, path(filename).parent_path());
cert = ndn::io::load<sec2::Certificate>(certfilePath.string());
if (cert == nullptr) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "cannot load certfile " + certfilePath.string() +
- " for authorize[" + to_string(authSectionIndex) + "]"));
+ NDN_THROW(ConfigFile::Error("cannot load certfile " + certfilePath.string() +
+ " for authorize[" + to_string(authSectionIndex) + "]"));
}
}
@@ -167,8 +165,8 @@
privSection = &authSection.get_child("privileges");
}
catch (const boost::property_tree::ptree_error&) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "'privileges' is missing under authorize[" + to_string(authSectionIndex) + "]"));
+ NDN_THROW(ConfigFile::Error("'privileges' is missing under authorize[" +
+ to_string(authSectionIndex) + "]"));
}
if (privSection->empty()) {
@@ -178,8 +176,8 @@
const std::string& module = kv.first;
auto found = m_validators.find(module);
if (found == m_validators.end()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "unknown module '" + module + "' under authorize[" + to_string(authSectionIndex) + "]"));
+ NDN_THROW(ConfigFile::Error("unknown module '" + module +
+ "' under authorize[" + to_string(authSectionIndex) + "]"));
}
if (isDryRun) {
@@ -195,8 +193,7 @@
const Name& keyName = cert->getKeyName();
sec2::Certificate certCopy = *cert;
found->second->loadAnchor(certfile, std::move(certCopy));
- NFD_LOG_INFO("authorize module=" << module << " signer=" << keyName <<
- " certfile=" << certfile);
+ NFD_LOG_INFO("authorize module=" << module << " signer=" << keyName << " certfile=" << certfile);
}
}
diff --git a/daemon/mgmt/general-config-section.cpp b/daemon/mgmt/general-config-section.cpp
index 6ed3af1..732074b 100644
--- a/daemon/mgmt/general-config-section.cpp
+++ b/daemon/mgmt/general-config-section.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -45,25 +45,23 @@
if (i.first == "user") {
try {
user = i.second.get_value<std::string>("user");
-
if (user.empty()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\" in \"general\" section"));
+ NDN_THROW(ConfigFile::Error("Invalid value for 'user' in section 'general'"));
}
}
catch (const boost::property_tree::ptree_error&) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"user\" in \"general\" section"));
+ NDN_THROW(ConfigFile::Error("Invalid value for 'user' in section 'general'"));
}
}
else if (i.first == "group") {
try {
group = i.second.get_value<std::string>("group");
-
if (group.empty()) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\" in \"general\" section"));
+ NDN_THROW(ConfigFile::Error("Invalid value for 'group' in section 'general'"));
}
}
catch (const boost::property_tree::ptree_error&) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error("Invalid value for \"group\" in \"general\" section"));
+ NDN_THROW(ConfigFile::Error("Invalid value for 'group' in section 'general'"));
}
}
}
diff --git a/daemon/mgmt/tables-config-section.cpp b/daemon/mgmt/tables-config-section.cpp
index 678b6e5..e5383a4 100644
--- a/daemon/mgmt/tables-config-section.cpp
+++ b/daemon/mgmt/tables-config-section.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -72,8 +72,7 @@
std::string policyName = csPolicyNode->get_value<std::string>();
csPolicy = cs::Policy::create(policyName);
if (csPolicy == nullptr) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "Unknown cs_policy \"" + policyName + "\" in \"tables\" section"));
+ NDN_THROW(ConfigFile::Error("Unknown cs_policy '" + policyName + "' in section 'tables'"));
}
}
@@ -83,8 +82,7 @@
std::string policyName = unsolicitedDataPolicyNode->get_value<std::string>();
unsolicitedDataPolicy = fw::UnsolicitedDataPolicy::create(policyName);
if (unsolicitedDataPolicy == nullptr) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "Unknown cs_unsolicited_policy \"" + policyName + "\" in \"tables\" section"));
+ NDN_THROW(ConfigFile::Error("Unknown cs_unsolicited_policy '" + policyName + "' in section 'tables'"));
}
}
else {
@@ -127,15 +125,14 @@
Name strategy(prefixAndStrategy.second.get_value<std::string>());
if (!Strategy::canCreate(strategy)) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "Unknown strategy \"" + prefixAndStrategy.second.get_value<std::string>() +
- "\" for prefix \"" + prefix.toUri() + "\" in \"strategy_choice\" section"));
+ NDN_THROW(ConfigFile::Error(
+ "Unknown strategy '" + prefixAndStrategy.second.get_value<std::string>() +
+ "' for prefix '" + prefix.toUri() + "' in section 'strategy_choice'"));
}
if (!choices.emplace(prefix, strategy).second) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "Duplicate strategy choice for prefix \"" + prefix.toUri() +
- "\" in \"strategy_choice\" section"));
+ NDN_THROW(ConfigFile::Error(
+ "Duplicate strategy choice for prefix '" + prefix.toUri() + "' in section 'strategy_choice'"));
}
}
@@ -146,9 +143,9 @@
StrategyChoice& sc = m_forwarder.getStrategyChoice();
for (const auto& prefixAndStrategy : choices) {
if (!sc.insert(prefixAndStrategy.first, prefixAndStrategy.second)) {
- BOOST_THROW_EXCEPTION(ConfigFile::Error(
- "Failed to set strategy \"" + prefixAndStrategy.second.toUri() + "\" for "
- "prefix \"" + prefixAndStrategy.first.toUri() + "\" in \"strategy_choicev\""));
+ NDN_THROW(ConfigFile::Error(
+ "Failed to set strategy '" + prefixAndStrategy.second.toUri() + "' for prefix '" +
+ prefixAndStrategy.first.toUri() + "' in section 'strategy_choice'"));
}
}
///\todo redesign so that strategy parameter errors can be catched during dry-run
@@ -161,11 +158,10 @@
return;
}
- NetworkRegionTable& nrt = m_forwarder.getNetworkRegionTable();
+ auto& nrt = m_forwarder.getNetworkRegionTable();
nrt.clear();
for (const auto& pair : section) {
- Name region(pair.first);
- nrt.insert(region);
+ nrt.insert(Name(pair.first));
}
}
diff --git a/daemon/table/dead-nonce-list.cpp b/daemon/table/dead-nonce-list.cpp
index 144e68e..a5bd9f8 100644
--- a/daemon/table/dead-nonce-list.cpp
+++ b/daemon/table/dead-nonce-list.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
, m_adjustCapacityInterval(m_lifetime)
{
if (m_lifetime < MIN_LIFETIME) {
- BOOST_THROW_EXCEPTION(std::invalid_argument("lifetime is less than MIN_LIFETIME"));
+ NDN_THROW(std::invalid_argument("lifetime is less than MIN_LIFETIME"));
}
for (size_t i = 0; i < EXPECTED_MARK_COUNT; ++i) {