Replace all uses of BOOST_THROW_EXCEPTION with NDN_THROW

Refs: #4834
Change-Id: If2455e1830f310beea434ffb455d960e11c4c2ed
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));
   }
 }