diff --git a/docs/code-style.rst b/docs/code-style.rst
index dfad354..cc71192 100644
--- a/docs/code-style.rst
+++ b/docs/code-style.rst
@@ -669,9 +669,9 @@
 2.24. Exceptions can be suffixed with either ``Exception`` (e.g., ``SecurityException``) or
 ``Error`` (e.g., ``SecurityError``).
 
-    The recommended method is to declare exception class ``Exception`` or ``Error`` as an
-    inner class, from which the exception is thrown.  For example, when declaring class
-    ``Foo`` that can throw errors, one can write the following:
+    The recommended method is to declare an exception class ``Exception`` or ``Error`` as
+    a nested type inside the class from which the exception is thrown.  For example, when
+    defining a class ``Foo`` that can throw errors, one can write the following:
 
     .. code-block:: c++
 
@@ -686,7 +686,7 @@
             // You can inherit constructors from std::runtime_error like this:
             using std::runtime_error::runtime_error;
 
-            // Additional constructors, if desired, can be declared like this:
+            // Additional constructors, if desired, can be declared as usual:
             Error(const std::string& what, const std::exception& inner)
               : std::runtime_error(what + ": " + inner.what())
             {
@@ -1084,7 +1084,6 @@
         };
 
 3.31. The recommended way to throw an exception derived from ``std::exception`` is to use
-the ``BOOST_THROW_EXCEPTION``
-`macro <https://www.boost.org/doc/libs/1_58_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html>`__.
-Exceptions thrown using this macro will be augmented with additional diagnostic information,
-including file name, line number, and function name from where the exception was thrown.
+``NDN_THROW`` or one of the other ``NDN_THROW_*`` macros.
+Exceptions thrown using these macros will be augmented with additional diagnostic information,
+including the file name, line number, and function name from which the exception was thrown.
diff --git a/ndn-cxx/data.cpp b/ndn-cxx/data.cpp
index e8e0841..abd4784 100644
--- a/ndn-cxx/data.cpp
+++ b/ndn-cxx/data.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -59,7 +59,7 @@
   // SignatureValue
   if (!wantUnsignedPortionOnly) {
     if (!m_signature) {
-      BOOST_THROW_EXCEPTION(Error("Requested wire format, but Data has not been signed"));
+      NDN_THROW(Error("Requested wire format, but Data has not been signed"));
     }
     totalLength += encoder.prependBlock(m_signature.getValue());
   }
@@ -133,7 +133,7 @@
 
   auto element = m_wire.elements_begin();
   if (element == m_wire.elements_end() || element->type() != tlv::Name) {
-    BOOST_THROW_EXCEPTION(Error("Name element is missing or out of order"));
+    NDN_THROW(Error("Name element is missing or out of order"));
   }
   m_name.wireDecode(*element);
   int lastElement = 1; // last recognized element index, in spec order
@@ -147,7 +147,7 @@
     switch (element->type()) {
       case tlv::MetaInfo: {
         if (lastElement >= 2) {
-          BOOST_THROW_EXCEPTION(Error("MetaInfo element is out of order"));
+          NDN_THROW(Error("MetaInfo element is out of order"));
         }
         m_metaInfo.wireDecode(*element);
         lastElement = 2;
@@ -155,7 +155,7 @@
       }
       case tlv::Content: {
         if (lastElement >= 3) {
-          BOOST_THROW_EXCEPTION(Error("Content element is out of order"));
+          NDN_THROW(Error("Content element is out of order"));
         }
         m_content = *element;
         lastElement = 3;
@@ -163,7 +163,7 @@
       }
       case tlv::SignatureInfo: {
         if (lastElement >= 4) {
-          BOOST_THROW_EXCEPTION(Error("SignatureInfo element is out of order"));
+          NDN_THROW(Error("SignatureInfo element is out of order"));
         }
         m_signature.setInfo(*element);
         lastElement = 4;
@@ -171,7 +171,7 @@
       }
       case tlv::SignatureValue: {
         if (lastElement >= 5) {
-          BOOST_THROW_EXCEPTION(Error("SignatureValue element is out of order"));
+          NDN_THROW(Error("SignatureValue element is out of order"));
         }
         m_signature.setValue(*element);
         lastElement = 5;
@@ -179,8 +179,7 @@
       }
       default: {
         if (tlv::isCriticalType(element->type())) {
-          BOOST_THROW_EXCEPTION(Error("unrecognized element of critical type " +
-                                      to_string(element->type())));
+          NDN_THROW(Error("unrecognized element of critical type " + to_string(element->type())));
         }
         break;
       }
@@ -188,7 +187,7 @@
   }
 
   if (!m_signature) {
-    BOOST_THROW_EXCEPTION(Error("SignatureInfo element is missing"));
+    NDN_THROW(Error("SignatureInfo element is missing"));
   }
 }
 
@@ -197,7 +196,7 @@
 {
   if (m_fullName.empty()) {
     if (!m_wire.hasWire()) {
-      BOOST_THROW_EXCEPTION(Error("Cannot compute full name because Data has no wire encoding (not signed)"));
+      NDN_THROW(Error("Cannot compute full name because Data has no wire encoding (not signed)"));
     }
     m_fullName = m_name;
     m_fullName.appendImplicitSha256Digest(util::Sha256::computeDigest(m_wire.wire(), m_wire.size()));
diff --git a/ndn-cxx/delegation-list.cpp b/ndn-cxx/delegation-list.cpp
index 33a9ad7..e2a5786 100644
--- a/ndn-cxx/delegation-list.cpp
+++ b/ndn-cxx/delegation-list.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -27,11 +27,6 @@
 BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<DelegationList>));
 BOOST_CONCEPT_ASSERT((WireDecodable<DelegationList>));
 
-DelegationList::Error::Error(const std::string& what, const std::exception& innerException)
-  : Error(what + ": "s + innerException.what())
-{
-}
-
 DelegationList::DelegationList()
   : m_isSorted(true)
 {
@@ -67,12 +62,12 @@
 DelegationList::wireEncode(EncodingImpl<TAG>& encoder, uint32_t type) const
 {
   if (!isValidTlvType(type)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid TLV-TYPE " + to_string(type) +
-                                                " when encoding DelegationList"));
+    NDN_THROW(std::invalid_argument("Unexpected TLV-TYPE " + to_string(type) +
+                                    " while encoding DelegationList"));
   }
 
   if (this->size() == 0) {
-    BOOST_THROW_EXCEPTION(Error("Empty DelegationList"));
+    NDN_THROW(Error("Empty DelegationList"));
   }
 
   // LinkContent ::= (type) TLV-LENGTH
@@ -109,8 +104,7 @@
 DelegationList::wireDecode(const Block& block, bool wantSort)
 {
   if (!isValidTlvType(block.type())) {
-    BOOST_THROW_EXCEPTION(Error("Unexpected TLV-TYPE " + to_string(block.type()) +
-                                " when decoding DelegationList"));
+    NDN_THROW(Error("Unexpected TLV-TYPE " + to_string(block.type()) + " while decoding DelegationList"));
   }
 
   m_isSorted = wantSort;
@@ -119,40 +113,39 @@
   block.parse();
   for (const auto& del : block.elements()) {
     if (del.type() != tlv::LinkDelegation) {
-      BOOST_THROW_EXCEPTION(Error("Unexpected TLV-TYPE " + to_string(del.type()) +
-                                  " when decoding Delegation"));
+      NDN_THROW(Error("Unexpected TLV-TYPE " + to_string(del.type()) + " while decoding Delegation"));
     }
     del.parse();
 
     auto val = del.elements_begin();
     if (val == del.elements_end() || val->type() != tlv::LinkPreference) {
-      BOOST_THROW_EXCEPTION(Error("Missing Preference field in Delegation"));
+      NDN_THROW(Error("Missing Preference field in Delegation"));
     }
     uint64_t preference = 0;
     try {
       preference = readNonNegativeInteger(*val);
     }
-    catch (const tlv::Error& inner) {
-      BOOST_THROW_EXCEPTION(Error("Invalid Preference field in Delegation", inner));
+    catch (const tlv::Error&) {
+      NDN_THROW_NESTED(Error("Invalid Preference field in Delegation"));
     }
 
     ++val;
     if (val == del.elements_end() || val->type() != tlv::Name) {
-      BOOST_THROW_EXCEPTION(Error("Missing Name field in Delegation"));
+      NDN_THROW(Error("Missing Name field in Delegation"));
     }
     Name name;
     try {
       name.wireDecode(*val);
     }
-    catch (const tlv::Error& inner) {
-      BOOST_THROW_EXCEPTION(Error("Invalid Name field in Delegation", inner));
+    catch (const tlv::Error&) {
+      NDN_THROW_NESTED(Error("Invalid Name field in Delegation"));
     }
 
     this->insertImpl(preference, name);
   }
 
   if (this->size() == 0) {
-    BOOST_THROW_EXCEPTION(Error("Empty DelegationList"));
+    NDN_THROW(Error("Empty DelegationList"));
   }
 }
 
diff --git a/ndn-cxx/delegation-list.hpp b/ndn-cxx/delegation-list.hpp
index b4c4ad3..031072f 100644
--- a/ndn-cxx/delegation-list.hpp
+++ b/ndn-cxx/delegation-list.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -41,8 +41,6 @@
   {
   public:
     using tlv::Error::Error;
-
-    Error(const std::string& what, const std::exception& innerException);
   };
 
   /** \brief construct an empty DelegationList
diff --git a/ndn-cxx/detail/cf-string-osx.cpp b/ndn-cxx/detail/cf-string-osx.cpp
index ea63fc7..5cceb33 100644
--- a/ndn-cxx/detail/cf-string-osx.cpp
+++ b/ndn-cxx/detail/cf-string-osx.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -30,7 +30,7 @@
 {
   CFStringRef cfStr = CFStringCreateWithBytes(kCFAllocatorDefault, buf, buflen, kCFStringEncodingUTF8, false);
   if (cfStr == nullptr) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Failed to create CFString from buffer"));
+    NDN_THROW(std::runtime_error("Failed to create CFString from buffer"));
   }
   return cfStr;
 }
@@ -40,7 +40,7 @@
 {
   CFStringRef cfStr = CFStringCreateWithCString(kCFAllocatorDefault, str.data(), kCFStringEncodingUTF8);
   if (cfStr == nullptr) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Failed to create CFString from std::string"));
+    NDN_THROW(std::runtime_error("Failed to create CFString from std::string"));
   }
   return cfStr;
 }
@@ -58,7 +58,7 @@
   std::string str(CFStringGetLength(cfStr) + 1, '\0');
   // copy the CFString into the std::string buffer
   if (!CFStringGetCString(cfStr, &str.front(), str.size(), kCFStringEncodingUTF8)) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("CFString to std::string conversion failed"));
+    NDN_THROW(std::runtime_error("CFString to std::string conversion failed"));
   }
   // drop the null terminator, std::string doesn't need it
   str.pop_back();
diff --git a/ndn-cxx/detail/common.hpp b/ndn-cxx/detail/common.hpp
index f5c95e6..b63d709 100644
--- a/ndn-cxx/detail/common.hpp
+++ b/ndn-cxx/detail/common.hpp
@@ -113,12 +113,12 @@
 #include <boost/assert.hpp>
 #include <boost/concept_check.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/throw_exception.hpp>
 
 namespace ndn {
 using boost::noncopyable;
 } // namespace ndn
 
 #include "ndn-cxx/util/backports.hpp"
+#include "ndn-cxx/util/exception.hpp"
 
 #endif // NDN_DETAIL_COMMON_HPP
diff --git a/ndn-cxx/encoding/block-helpers.cpp b/ndn-cxx/encoding/block-helpers.cpp
index e5a501f..82d2ff8 100644
--- a/ndn-cxx/encoding/block-helpers.cpp
+++ b/ndn-cxx/encoding/block-helpers.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -156,7 +156,7 @@
 readDouble(const Block& block)
 {
   if (block.value_size() != 8) {
-    BOOST_THROW_EXCEPTION(tlv::Error("Invalid length for double (must be 8)"));
+    NDN_THROW(tlv::Error("Invalid length for double (must be 8)"));
   }
 
   uint64_t temp = 0;
diff --git a/ndn-cxx/encoding/block-helpers.hpp b/ndn-cxx/encoding/block-helpers.hpp
index a8de879..fd29186 100644
--- a/ndn-cxx/encoding/block-helpers.hpp
+++ b/ndn-cxx/encoding/block-helpers.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -73,8 +73,7 @@
 {
   uint64_t value = readNonNegativeInteger(block);
   if (value > std::numeric_limits<R>::max()) {
-    BOOST_THROW_EXCEPTION(tlv::Error("Value in TLV element of type " + to_string(block.type()) +
-                          " is too large"));
+    NDN_THROW(tlv::Error("Value in TLV element of type " + to_string(block.type()) + " is too large"));
   }
   return static_cast<R>(value);
 }
diff --git a/ndn-cxx/encoding/block.cpp b/ndn-cxx/encoding/block.cpp
index e584467..5e51baf 100644
--- a/ndn-cxx/encoding/block.cpp
+++ b/ndn-cxx/encoding/block.cpp
@@ -67,14 +67,14 @@
   , m_size(m_end - m_begin)
 {
   if (m_buffer->size() == 0) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("buffer is empty"));
+    NDN_THROW(std::invalid_argument("Buffer is empty"));
   }
 
   const uint8_t* bufferBegin = &m_buffer->front();
   const uint8_t* bufferEnd = bufferBegin + m_buffer->size();
   if (&*begin < bufferBegin || &*begin > bufferEnd ||
       &*end   < bufferBegin || &*end   > bufferEnd) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("begin/end iterators points out of the buffer"));
+    NDN_THROW(std::invalid_argument("Begin/end iterators point outside the buffer"));
   }
 
   m_type = tlv::readType(m_valueBegin, m_valueEnd);
@@ -82,7 +82,7 @@
   // m_valueBegin now points to TLV-VALUE
 
   if (verifyLength && length != static_cast<uint64_t>(m_valueEnd - m_valueBegin)) {
-    BOOST_THROW_EXCEPTION(Error("TLV-LENGTH doesn't match buffer size"));
+    NDN_THROW(Error("TLV-LENGTH does not match buffer size"));
   }
 }
 
@@ -116,7 +116,7 @@
 
   BOOST_ASSERT(pos <= end);
   if (length > static_cast<uint64_t>(end - pos)) {
-    BOOST_THROW_EXCEPTION(Error("Not enough bytes in the buffer to fully parse TLV"));
+    NDN_THROW(Error("Not enough bytes in the buffer to fully parse TLV"));
   }
 
   BOOST_ASSERT(pos > buf);
@@ -171,14 +171,14 @@
 
   size_t tlSize = tlv::sizeOfVarNumber(type) + tlv::sizeOfVarNumber(length);
   if (tlSize + length > MAX_SIZE_OF_BLOCK_FROM_STREAM) {
-    BOOST_THROW_EXCEPTION(Error("TLV-LENGTH from stream exceeds limit"));
+    NDN_THROW(Error("TLV-LENGTH from stream exceeds limit"));
   }
 
   EncodingBuffer eb(tlSize + length, length);
   uint8_t* valueBuf = eb.buf();
   is.read(reinterpret_cast<char*>(valueBuf), length);
   if (length != static_cast<uint64_t>(is.gcount())) {
-    BOOST_THROW_EXCEPTION(Error("Not enough bytes from stream to fully parse TLV"));
+    NDN_THROW(Error("Not enough bytes from stream to fully parse TLV"));
   }
 
   eb.prependVarNumber(length);
@@ -262,7 +262,7 @@
 Block::begin() const
 {
   if (!hasWire())
-    BOOST_THROW_EXCEPTION(Error("Underlying wire buffer is empty"));
+    NDN_THROW(Error("Underlying wire buffer is empty"));
 
   return m_begin;
 }
@@ -271,7 +271,7 @@
 Block::end() const
 {
   if (!hasWire())
-    BOOST_THROW_EXCEPTION(Error("Underlying wire buffer is empty"));
+    NDN_THROW(Error("Underlying wire buffer is empty"));
 
   return m_end;
 }
@@ -280,7 +280,7 @@
 Block::wire() const
 {
   if (!hasWire())
-    BOOST_THROW_EXCEPTION(Error("Underlying wire buffer is empty"));
+    NDN_THROW(Error("Underlying wire buffer is empty"));
 
   return &*m_begin;
 }
@@ -289,7 +289,7 @@
 Block::size() const
 {
   if (empty()) {
-    BOOST_THROW_EXCEPTION(Error("Block size cannot be determined (undefined block size)"));
+    NDN_THROW(Error("Block size cannot be determined (undefined block size)"));
   }
 
   return m_size;
@@ -313,7 +313,7 @@
 Block::blockFromValue() const
 {
   if (!hasValue())
-    BOOST_THROW_EXCEPTION(Error("Block has no TLV-VALUE"));
+    NDN_THROW(Error("Block has no TLV-VALUE"));
 
   return Block(*this, m_valueBegin, m_valueEnd, true);
 }
@@ -336,8 +336,8 @@
     uint64_t length = tlv::readVarNumber(pos, end);
     if (length > static_cast<uint64_t>(end - pos)) {
       m_elements.clear();
-      BOOST_THROW_EXCEPTION(Error("TLV-LENGTH of sub-element of type " + to_string(type) +
-                                  " exceeds TLV-VALUE boundary of parent block"));
+      NDN_THROW(Error("TLV-LENGTH of sub-element of type " + to_string(type) +
+                      " exceeds TLV-VALUE boundary of parent block"));
     }
     // pos now points to TLV-VALUE of sub element
 
@@ -417,8 +417,8 @@
     return *it;
   }
 
-  BOOST_THROW_EXCEPTION(Error("No sub-element of type " + to_string(type) +
-                              " is found in block of type " + to_string(m_type)));
+  NDN_THROW(Error("No sub-element of type " + to_string(type) +
+                  " found in block of type " + to_string(m_type)));
 }
 
 Block::element_const_iterator
@@ -527,7 +527,7 @@
     ss.end();
   }
   catch (const t::Error&) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("input has odd number of hexadecimal digits"));
+    NDN_THROW(std::invalid_argument("Input has odd number of hexadecimal digits"));
   }
 
   return Block(os.buf());
diff --git a/ndn-cxx/encoding/tlv.cpp b/ndn-cxx/encoding/tlv.cpp
index babaf3d..a9feab7 100644
--- a/ndn-cxx/encoding/tlv.cpp
+++ b/ndn-cxx/encoding/tlv.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,6 +24,11 @@
 namespace ndn {
 namespace tlv {
 
+Error::Error(const char* expectedType, uint32_t actualType)
+  : Error("Expecting "s + expectedType + " element, but TLV has type " + to_string(actualType))
+{
+}
+
 std::ostream&
 operator<<(std::ostream& os, SignatureTypeValue st)
 {
diff --git a/ndn-cxx/encoding/tlv.hpp b/ndn-cxx/encoding/tlv.hpp
index f1cb59d..1b665fc 100644
--- a/ndn-cxx/encoding/tlv.hpp
+++ b/ndn-cxx/encoding/tlv.hpp
@@ -53,6 +53,8 @@
 {
 public:
   using std::runtime_error::runtime_error;
+
+  Error(const char* expectedType, uint32_t actualType);
 };
 
 /** @brief TLV-TYPE numbers defined in NDN Packet Format v0.3
@@ -420,13 +422,13 @@
 readVarNumber(Iterator& begin, Iterator end)
 {
   if (begin == end) {
-    BOOST_THROW_EXCEPTION(Error("Empty buffer during TLV parsing"));
+    NDN_THROW(Error("Empty buffer during TLV parsing"));
   }
 
   uint64_t value = 0;
   bool isOk = readVarNumber(begin, end, value);
   if (!isOk) {
-    BOOST_THROW_EXCEPTION(Error("Insufficient data during TLV parsing"));
+    NDN_THROW(Error("Insufficient data during TLV parsing"));
   }
 
   return value;
@@ -438,7 +440,7 @@
 {
   uint64_t type = readVarNumber(begin, end);
   if (type > std::numeric_limits<uint32_t>::max()) {
-    BOOST_THROW_EXCEPTION(Error("TLV-TYPE number exceeds allowed maximum"));
+    NDN_THROW(Error("TLV-TYPE number exceeds allowed maximum"));
   }
 
   return static_cast<uint32_t>(type);
@@ -484,14 +486,13 @@
 readNonNegativeInteger(size_t size, Iterator& begin, Iterator end)
 {
   if (size != 1 && size != 2 && size != 4 && size != 8) {
-    BOOST_THROW_EXCEPTION(Error("Invalid length for nonNegativeInteger "
-                                "(only 1, 2, 4, and 8 are allowed)"));
+    NDN_THROW(Error("Invalid length " + to_string(size) + " for nonNegativeInteger"));
   }
 
   uint64_t number = 0;
   bool isOk = detail::ReadNumber<Iterator>()(size, begin, end, number);
   if (!isOk) {
-    BOOST_THROW_EXCEPTION(Error("Insufficient data during TLV parsing"));
+    NDN_THROW(Error("Insufficient data during nonNegativeInteger parsing"));
   }
 
   return number;
diff --git a/ndn-cxx/exclude.cpp b/ndn-cxx/exclude.cpp
index a8a5cd4..3204850 100644
--- a/ndn-cxx/exclude.cpp
+++ b/ndn-cxx/exclude.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -122,7 +122,7 @@
 Exclude::wireEncode(EncodingImpl<TAG>& encoder) const
 {
   if (m_entries.empty()) {
-    BOOST_THROW_EXCEPTION(Error("cannot encode empty Exclude selector"));
+    NDN_THROW(Error("cannot encode empty Exclude selector"));
   }
 
   size_t totalLength = 0;
@@ -168,13 +168,13 @@
   clear();
 
   if (wire.type() != tlv::Exclude)
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV type when decoding Exclude"));
+    NDN_THROW(tlv::Error("Unexpected TLV type when decoding Exclude"));
 
   m_wire = wire;
   m_wire.parse();
 
   if (m_wire.elements_size() == 0) {
-    BOOST_THROW_EXCEPTION(Error("Exclude element cannot be empty"));
+    NDN_THROW(Error("Exclude element cannot be empty"));
   }
 
   // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (GenericNameComponent (Any)?)+
@@ -192,10 +192,10 @@
       component = name::Component(*i);
     }
     catch (const name::Component::Error&) {
-      BOOST_THROW_EXCEPTION(Error("Incorrect format of Exclude filter"));
+      NDN_THROW_NESTED(Error("Incorrect format of Exclude filter"));
     }
     if (!component.isGeneric() && !component.isImplicitSha256Digest()) {
-      BOOST_THROW_EXCEPTION(Error("Excluded component must be generic or ImplicitSha256Digest"));
+      NDN_THROW(Error("Excluded component must be generic or ImplicitSha256Digest"));
     }
     ++i;
 
@@ -274,8 +274,8 @@
 Exclude::excludeRange(const ExcludeComponent& from, const name::Component& to)
 {
   if (!from.isNegInf && from.component >= to) {
-    BOOST_THROW_EXCEPTION(Error("Invalid exclude range [" + from.component.toUri() + ", " + to.toUri() + "] "
-                                "(for single name exclude use Exclude::excludeOne)"));
+    NDN_THROW(Error("Invalid exclude range [" + from.component.toUri() + ", " + to.toUri() + "] "
+                    "(for single name exclude use Exclude::excludeOne)"));
   }
 
   ExcludeMap::iterator newFrom = m_entries.lower_bound(from);
diff --git a/ndn-cxx/face.cpp b/ndn-cxx/face.cpp
index 58c2617..a134e8e 100644
--- a/ndn-cxx/face.cpp
+++ b/ndn-cxx/face.cpp
@@ -138,14 +138,14 @@
       return TcpTransport::create(transportUri);
     }
     else {
-      BOOST_THROW_EXCEPTION(ConfigFile::Error("Unsupported transport protocol \"" + protocol + "\""));
+      NDN_THROW(ConfigFile::Error("Unsupported transport protocol \"" + protocol + "\""));
     }
   }
-  catch (const Transport::Error& error) {
-    BOOST_THROW_EXCEPTION(ConfigFile::Error(error.what()));
+  catch (const Transport::Error&) {
+    NDN_THROW_NESTED(ConfigFile::Error("Failed to create transport"));
   }
-  catch (const FaceUri::Error& error) {
-    BOOST_THROW_EXCEPTION(ConfigFile::Error(error.what()));
+  catch (const FaceUri::Error&) {
+    NDN_THROW_NESTED(ConfigFile::Error("Failed to create transport"));
   }
 }
 
diff --git a/ndn-cxx/impl/face-impl.hpp b/ndn-cxx/impl/face-impl.hpp
index 14599ab..5b5c39e 100644
--- a/ndn-cxx/impl/face-impl.hpp
+++ b/ndn-cxx/impl/face-impl.hpp
@@ -416,7 +416,7 @@
     }
 
     if (wire.size() > MAX_NDN_PACKET_SIZE) {
-      BOOST_THROW_EXCEPTION(Face::OversizedPacketError(pktType, name, wire.size()));
+      NDN_THROW(Face::OversizedPacketError(pktType, name, wire.size()));
     }
 
     return wire;
diff --git a/ndn-cxx/impl/name-component-types.hpp b/ndn-cxx/impl/name-component-types.hpp
index aaa3606..63fa4f2 100644
--- a/ndn-cxx/impl/name-component-types.hpp
+++ b/ndn-cxx/impl/name-component-types.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -189,8 +189,7 @@
   check(const Component& comp) const final
   {
     if (!match(comp)) {
-      BOOST_THROW_EXCEPTION(Error(m_typeName + " TLV-LENGTH must be " +
-                                  to_string(util::Sha256::DIGEST_SIZE)));
+      NDN_THROW(Error(m_typeName + " TLV-LENGTH must be " + to_string(util::Sha256::DIGEST_SIZE)));
     }
   }
 
@@ -239,7 +238,7 @@
       value = fromHex(input);
     }
     catch (const StringHelperError&) {
-      BOOST_THROW_EXCEPTION(Error("Cannot convert to " + m_typeName + " (invalid hex encoding)"));
+      NDN_THROW(Error("Cannot convert to " + m_typeName + " (invalid hex encoding)"));
     }
     return Component(m_type, std::move(value));
   }
diff --git a/ndn-cxx/ims/in-memory-storage.cpp b/ndn-cxx/ims/in-memory-storage.cpp
index 31ec616..c0499a9 100644
--- a/ndn-cxx/ims/in-memory-storage.cpp
+++ b/ndn-cxx/ims/in-memory-storage.cpp
@@ -137,7 +137,7 @@
     ssize_t nAllowedFailures = size() - m_capacity;
     while (size() > m_capacity) {
       if (!evictItem() && --nAllowedFailures < 0) {
-        BOOST_THROW_EXCEPTION(Error());
+        NDN_THROW(Error());
       }
     }
   }
diff --git a/ndn-cxx/interest-filter.cpp b/ndn-cxx/interest-filter.cpp
index a24e2d2..173c4dd 100644
--- a/ndn-cxx/interest-filter.cpp
+++ b/ndn-cxx/interest-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -48,8 +48,8 @@
 InterestFilter::operator const Name&() const
 {
   if (hasRegexFilter()) {
-    BOOST_THROW_EXCEPTION(Error("Please update InterestCallback to accept const InterestFilter&"
-                                " (non-trivial InterestFilter is being used)"));
+    NDN_THROW(Error("Please update InterestCallback to accept `const InterestFilter&'"
+                    " (non-trivial InterestFilter is being used)"));
   }
   return m_prefix;
 }
diff --git a/ndn-cxx/interest.cpp b/ndn-cxx/interest.cpp
index 1fb3f1f..cebc226 100644
--- a/ndn-cxx/interest.cpp
+++ b/ndn-cxx/interest.cpp
@@ -49,7 +49,7 @@
   , m_interestLifetime(lifetime)
 {
   if (lifetime < 0_ms) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("InterestLifetime must be >= 0"));
+    NDN_THROW(std::invalid_argument("InterestLifetime must be >= 0"));
   }
 
   if (!boost::logic::indeterminate(s_defaultCanBePrefix)) {
@@ -78,7 +78,7 @@
     }
 #ifdef NDN_CXX_HAVE_TESTS
     if (s_errorIfCanBePrefixUnset) {
-      BOOST_THROW_EXCEPTION(std::logic_error("Interest.CanBePrefix is unset"));
+      NDN_THROW(std::logic_error("Interest.CanBePrefix is unset"));
     }
 #endif // NDN_CXX_HAVE_TESTS
   }
@@ -220,7 +220,7 @@
   m_wire.parse();
 
   if (m_wire.type() != tlv::Interest) {
-    BOOST_THROW_EXCEPTION(Error("expecting Interest element, got " + to_string(m_wire.type())));
+    NDN_THROW(Error("Interest", m_wire.type()));
   }
 
   if (!decode02()) {
@@ -260,7 +260,7 @@
   if (element != m_wire.elements_end() && element->type() == tlv::Nonce) {
     uint32_t nonce = 0;
     if (element->value_size() != sizeof(nonce)) {
-      BOOST_THROW_EXCEPTION(Error("Nonce element is malformed"));
+      NDN_THROW(Error("Nonce element is malformed"));
     }
     std::memcpy(&nonce, element->value(), sizeof(nonce));
     m_nonce = nonce;
@@ -306,11 +306,11 @@
 
   auto element = m_wire.elements_begin();
   if (element == m_wire.elements_end() || element->type() != tlv::Name) {
-    BOOST_THROW_EXCEPTION(Error("Name element is missing or out of order"));
+    NDN_THROW(Error("Name element is missing or out of order"));
   }
   m_name.wireDecode(*element);
   if (m_name.empty()) {
-    BOOST_THROW_EXCEPTION(Error("Name has zero name components"));
+    NDN_THROW(Error("Name has zero name components"));
   }
   int lastElement = 1; // last recognized element index, in spec order
 
@@ -324,10 +324,10 @@
     switch (element->type()) {
       case tlv::CanBePrefix: {
         if (lastElement >= 2) {
-          BOOST_THROW_EXCEPTION(Error("CanBePrefix element is out of order"));
+          NDN_THROW(Error("CanBePrefix element is out of order"));
         }
         if (element->value_size() != 0) {
-          BOOST_THROW_EXCEPTION(Error("CanBePrefix element has non-zero TLV-LENGTH"));
+          NDN_THROW(Error("CanBePrefix element has non-zero TLV-LENGTH"));
         }
         m_selectors.setMaxSuffixComponents(-1);
         lastElement = 2;
@@ -335,10 +335,10 @@
       }
       case tlv::MustBeFresh: {
         if (lastElement >= 3) {
-          BOOST_THROW_EXCEPTION(Error("MustBeFresh element is out of order"));
+          NDN_THROW(Error("MustBeFresh element is out of order"));
         }
         if (element->value_size() != 0) {
-          BOOST_THROW_EXCEPTION(Error("MustBeFresh element has non-zero TLV-LENGTH"));
+          NDN_THROW(Error("MustBeFresh element has non-zero TLV-LENGTH"));
         }
         m_selectors.setMustBeFresh(true);
         lastElement = 3;
@@ -346,7 +346,7 @@
       }
       case tlv::ForwardingHint: {
         if (lastElement >= 4) {
-          BOOST_THROW_EXCEPTION(Error("ForwardingHint element is out of order"));
+          NDN_THROW(Error("ForwardingHint element is out of order"));
         }
         m_forwardingHint.wireDecode(*element);
         lastElement = 4;
@@ -354,11 +354,11 @@
       }
       case tlv::Nonce: {
         if (lastElement >= 5) {
-          BOOST_THROW_EXCEPTION(Error("Nonce element is out of order"));
+          NDN_THROW(Error("Nonce element is out of order"));
         }
         uint32_t nonce = 0;
         if (element->value_size() != sizeof(nonce)) {
-          BOOST_THROW_EXCEPTION(Error("Nonce element is malformed"));
+          NDN_THROW(Error("Nonce element is malformed"));
         }
         std::memcpy(&nonce, element->value(), sizeof(nonce));
         m_nonce = nonce;
@@ -367,7 +367,7 @@
       }
       case tlv::InterestLifetime: {
         if (lastElement >= 6) {
-          BOOST_THROW_EXCEPTION(Error("InterestLifetime element is out of order"));
+          NDN_THROW(Error("InterestLifetime element is out of order"));
         }
         m_interestLifetime = time::milliseconds(readNonNegativeInteger(*element));
         lastElement = 6;
@@ -378,7 +378,7 @@
           break; // HopLimit is non-critical, ignore out-of-order appearance
         }
         if (element->value_size() != 1) {
-          BOOST_THROW_EXCEPTION(Error("HopLimit element is malformed"));
+          NDN_THROW(Error("HopLimit element is malformed"));
         }
         // TLV-VALUE is ignored
         lastElement = 7;
@@ -394,8 +394,7 @@
       }
       default: {
         if (tlv::isCriticalType(element->type())) {
-          BOOST_THROW_EXCEPTION(Error("unrecognized element of critical type " +
-                                      to_string(element->type())));
+          NDN_THROW(Error("Unrecognized element of critical type " + to_string(element->type())));
         }
         break;
       }
@@ -567,7 +566,7 @@
 Interest::setInterestLifetime(time::milliseconds lifetime)
 {
   if (lifetime < 0_ms) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("InterestLifetime must be >= 0"));
+    NDN_THROW(std::invalid_argument("InterestLifetime must be >= 0"));
   }
   m_interestLifetime = lifetime;
   m_wire.reset();
diff --git a/ndn-cxx/key-locator.cpp b/ndn-cxx/key-locator.cpp
index 453511e..5fe3b95 100644
--- a/ndn-cxx/key-locator.cpp
+++ b/ndn-cxx/key-locator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -66,7 +66,7 @@
     totalLength += encoder.prependBlock(m_keyDigest);
     break;
   default:
-    BOOST_THROW_EXCEPTION(Error("Unsupported KeyLocator type"));
+    NDN_THROW(Error("Unsupported KeyLocator type " + to_string(m_type)));
   }
 
   totalLength += encoder.prependVarNumber(totalLength);
@@ -96,7 +96,7 @@
 KeyLocator::wireDecode(const Block& wire)
 {
   if (wire.type() != tlv::KeyLocator)
-    BOOST_THROW_EXCEPTION(Error("Unexpected TLV type during KeyLocator decoding"));
+    NDN_THROW(Error("KeyLocator", wire.type()));
 
   m_wire = wire;
   m_wire.parse();
@@ -135,7 +135,7 @@
 KeyLocator::getName() const
 {
   if (m_type != KeyLocator_Name)
-    BOOST_THROW_EXCEPTION(Error("KeyLocator type is not Name"));
+    NDN_THROW(Error("KeyLocator type is not Name"));
 
   return m_name;
 }
@@ -153,7 +153,7 @@
 KeyLocator::getKeyDigest() const
 {
   if (m_type != KeyLocator_KeyDigest)
-    BOOST_THROW_EXCEPTION(Error("KeyLocator type is not KeyDigest"));
+    NDN_THROW(Error("KeyLocator type is not KeyDigest"));
 
   return m_keyDigest;
 }
@@ -162,7 +162,7 @@
 KeyLocator::setKeyDigest(const Block& keyDigest)
 {
   if (keyDigest.type() != tlv::KeyDigest)
-    BOOST_THROW_EXCEPTION(Error("expecting KeyDigest block"));
+    NDN_THROW(Error("KeyDigest", keyDigest.type()));
 
   this->clear();
   m_type = KeyLocator_KeyDigest;
diff --git a/ndn-cxx/link.cpp b/ndn-cxx/link.cpp
index c1e056e..ab5cb0d 100644
--- a/ndn-cxx/link.cpp
+++ b/ndn-cxx/link.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -69,7 +69,7 @@
   Data::wireDecode(wire);
 
   if (getContentType() != tlv::ContentType_Link) {
-    BOOST_THROW_EXCEPTION(Error("Expected ContentType Link"));
+    NDN_THROW(Error("Expecting ContentType Link, got " + to_string(getContentType())));
   }
 
   m_delList.wireDecode(getContent(), wantSort);
diff --git a/ndn-cxx/lp/cache-policy.cpp b/ndn-cxx/lp/cache-policy.cpp
index 20d9662..1bc1aa1 100644
--- a/ndn-cxx/lp/cache-policy.cpp
+++ b/ndn-cxx/lp/cache-policy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -57,7 +57,7 @@
 CachePolicy::wireEncode(EncodingImpl<TAG>& encoder) const
 {
   if (m_policy == CachePolicyType::NONE) {
-    BOOST_THROW_EXCEPTION(Error("CachePolicyType must be set"));
+    NDN_THROW(Error("CachePolicyType must be set"));
   }
 
   size_t length = 0;
@@ -73,7 +73,7 @@
 CachePolicy::wireEncode() const
 {
   if (m_policy == CachePolicyType::NONE) {
-    BOOST_THROW_EXCEPTION(Error("CachePolicyType must be set"));
+    NDN_THROW(Error("CachePolicyType must be set"));
   }
 
   if (m_wire.hasWire()) {
@@ -95,21 +95,25 @@
 CachePolicy::wireDecode(const Block& wire)
 {
   if (wire.type() != tlv::CachePolicy) {
-    BOOST_THROW_EXCEPTION(Error("expecting CachePolicy block"));
+    NDN_THROW(Error("CachePolicy", wire.type()));
   }
 
   m_wire = wire;
   m_wire.parse();
 
-  Block::element_const_iterator it = m_wire.elements_begin();
-  if (it != m_wire.elements_end() && it->type() == tlv::CachePolicyType) {
+  auto it = m_wire.elements_begin();
+  if (it == m_wire.elements_end()) {
+    NDN_THROW(Error("Empty CachePolicy"));
+  }
+
+  if (it->type() == tlv::CachePolicyType) {
     m_policy = static_cast<CachePolicyType>(readNonNegativeInteger(*it));
     if (this->getPolicy() == CachePolicyType::NONE) {
-      BOOST_THROW_EXCEPTION(Error("unknown CachePolicyType"));
+      NDN_THROW(Error("Unknown CachePolicyType"));
     }
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("expecting CachePolicyType block"));
+    NDN_THROW(Error("CachePolicyType", it->type()));
   }
 }
 
diff --git a/ndn-cxx/lp/field-decl.hpp b/ndn-cxx/lp/field-decl.hpp
index 95d8246..627ae13 100644
--- a/ndn-cxx/lp/field-decl.hpp
+++ b/ndn-cxx/lp/field-decl.hpp
@@ -59,10 +59,9 @@
   decode(const Block& wire)
   {
     if (wire.value_size() != 0) {
-      BOOST_THROW_EXCEPTION(ndn::tlv::Error("NDNLP field of TLV-TYPE " + to_string(wire.type()) +
-                                            " must be empty"));
+      NDN_THROW(ndn::tlv::Error("NDNLP field of TLV-TYPE " + to_string(wire.type()) +
+                                " must be empty"));
     }
-
     return EmptyValue{};
   }
 };
@@ -84,8 +83,8 @@
   decode(const Block& wire)
   {
     if (wire.value_size() != sizeof(uint64_t)) {
-      BOOST_THROW_EXCEPTION(ndn::tlv::Error("NDNLP field of TLV-TYPE " + to_string(wire.type()) +
-                                            " should contain a 64-bit integer"));
+      NDN_THROW(ndn::tlv::Error("NDNLP field of TLV-TYPE " + to_string(wire.type()) +
+                                " must contain a 64-bit integer"));
     }
     uint64_t n = 0;
     std::memcpy(&n, wire.value(), sizeof(n));
@@ -100,10 +99,9 @@
   decode(const Block& wire)
   {
     if (wire.value_size() == 0) {
-      BOOST_THROW_EXCEPTION(ndn::tlv::Error("NDNLP field of TLV-TYPE " + to_string(wire.type()) +
-                                            " cannot be empty"));
+      NDN_THROW(ndn::tlv::Error("NDNLP field of TLV-TYPE " + to_string(wire.type()) +
+                                " cannot be empty"));
     }
-
     return std::make_pair(wire.value_begin(), wire.value_end());
   }
 };
@@ -195,7 +193,7 @@
   decode(const Block& wire)
   {
     if (wire.type() != TlvType::value) {
-      BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV-TYPE " + to_string(wire.type())));
+      NDN_THROW(ndn::tlv::Error("Unexpected TLV-TYPE " + to_string(wire.type())));
     }
 
     return DecodeHelper<TlvType, DECODER_TAG>::decode(wire);
diff --git a/ndn-cxx/lp/nack-header.cpp b/ndn-cxx/lp/nack-header.cpp
index 9a123ff..b9f5ffb 100644
--- a/ndn-cxx/lp/nack-header.cpp
+++ b/ndn-cxx/lp/nack-header.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -104,7 +104,7 @@
 NackHeader::wireDecode(const Block& wire)
 {
   if (wire.type() != tlv::Nack) {
-    BOOST_THROW_EXCEPTION(ndn::tlv::Error("expecting Nack block"));
+    NDN_THROW(ndn::tlv::Error("Nack", wire.type()));
   }
 
   m_wire = wire;
@@ -118,7 +118,7 @@
       m_reason = static_cast<NackReason>(readNonNegativeInteger(*it));
     }
     else {
-      BOOST_THROW_EXCEPTION(ndn::tlv::Error("expecting NackReason block"));
+      NDN_THROW(ndn::tlv::Error("NackReason", it->type()));
     }
   }
 }
diff --git a/ndn-cxx/lp/packet.cpp b/ndn-cxx/lp/packet.cpp
index d3e2a1d..9b84892 100644
--- a/ndn-cxx/lp/packet.cpp
+++ b/ndn-cxx/lp/packet.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -139,7 +139,7 @@
   }
 
   if (wire.type() != tlv::LpPacket) {
-    BOOST_THROW_EXCEPTION(Error("unrecognized TLV-TYPE " + to_string(wire.type())));
+    NDN_THROW(Error("LpPacket", wire.type()));
   }
 
   wire.parse();
@@ -150,16 +150,16 @@
     FieldInfo info(element.type());
 
     if (!info.isRecognized && !info.canIgnore) {
-      BOOST_THROW_EXCEPTION(Error("unrecognized field " + to_string(element.type()) + " cannot be ignored"));
+      NDN_THROW(Error("unrecognized field " + to_string(element.type()) + " cannot be ignored"));
     }
 
     if (!isFirst) {
       if (info.tlvType == prev.tlvType && !info.isRepeatable) {
-        BOOST_THROW_EXCEPTION(Error("non-repeatable field " + to_string(element.type()) + " cannot be repeated"));
+        NDN_THROW(Error("non-repeatable field " + to_string(element.type()) + " cannot be repeated"));
       }
 
       else if (info.tlvType != prev.tlvType && !compareFieldSortOrder(prev, info)) {
-        BOOST_THROW_EXCEPTION(Error("fields are not in correct sort order"));
+        NDN_THROW(Error("fields are not in correct sort order"));
       }
     }
 
diff --git a/ndn-cxx/lp/packet.hpp b/ndn-cxx/lp/packet.hpp
index e515134..624a0a5 100644
--- a/ndn-cxx/lp/packet.hpp
+++ b/ndn-cxx/lp/packet.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -84,8 +84,7 @@
   count() const
   {
     return std::count_if(m_wire.elements_begin(), m_wire.elements_end(),
-                         [] (const Block& block) {
-                           return block.type() == FIELD::TlvType::value; });
+                         [] (const Block& block) { return block.type() == FIELD::TlvType::value; });
   }
 
   /**
@@ -106,7 +105,7 @@
       }
     }
 
-    BOOST_THROW_EXCEPTION(std::out_of_range("Index out of range"));
+    NDN_THROW(std::out_of_range("lp::Packet::get: index out of range"));
   }
 
   /**
@@ -142,14 +141,14 @@
 
   /**
    * \brief add a FIELD with value
-   * \throw std::length_error if field already exists and is not repeatable
+   * \throw std::invalid_argument if field already exists and is not repeatable
    */
   template<typename FIELD>
   Packet&
   add(const typename FIELD::ValueType& value)
   {
     if (!FIELD::IsRepeatable::value && has<FIELD>()) {
-      BOOST_THROW_EXCEPTION(std::length_error("Field cannot be repeated"));
+      NDN_THROW(std::invalid_argument("lp::Packet::add: field cannot be repeated"));
     }
 
     EncodingEstimator estimator;
@@ -184,7 +183,7 @@
       }
     }
 
-    BOOST_THROW_EXCEPTION(std::out_of_range("Index out of range"));
+    NDN_THROW(std::out_of_range("lp::Packet::remove: index out of range"));
   }
 
   /**
diff --git a/ndn-cxx/lp/prefix-announcement-header.cpp b/ndn-cxx/lp/prefix-announcement-header.cpp
index 5433099..8761be1 100644
--- a/ndn-cxx/lp/prefix-announcement-header.cpp
+++ b/ndn-cxx/lp/prefix-announcement-header.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -36,7 +36,7 @@
   : m_prefixAnn(std::move(prefixAnn))
 {
   if (m_prefixAnn->getData() == nullopt) {
-    BOOST_THROW_EXCEPTION(Error("PrefixAnnouncement does not contain Data"));
+    NDN_THROW(Error("PrefixAnnouncement does not contain Data"));
   }
 }
 
@@ -45,7 +45,7 @@
 PrefixAnnouncementHeader::wireEncode(EncodingImpl<TAG>& encoder) const
 {
   if (m_prefixAnn == nullopt) {
-    BOOST_THROW_EXCEPTION(Error("PrefixAnnouncementHeader does not contain a PrefixAnnouncement"));
+    NDN_THROW(Error("PrefixAnnouncementHeader does not contain a PrefixAnnouncement"));
   }
 
   size_t length = 0;
@@ -61,7 +61,7 @@
 PrefixAnnouncementHeader::wireDecode(const Block& wire)
 {
   if (wire.type() != tlv::PrefixAnnouncement) {
-    BOOST_THROW_EXCEPTION(Error("Unexpected TLV-TYPE " + to_string(wire.type())));
+    NDN_THROW(Error("PrefixAnnouncement", wire.type()));
   }
 
   wire.parse();
diff --git a/ndn-cxx/meta-info.cpp b/ndn-cxx/meta-info.cpp
index eca1f25..b53a58c 100644
--- a/ndn-cxx/meta-info.cpp
+++ b/ndn-cxx/meta-info.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -55,7 +55,7 @@
 MetaInfo::setFreshnessPeriod(time::milliseconds freshnessPeriod)
 {
   if (freshnessPeriod < time::milliseconds::zero()) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("FreshnessPeriod must be >= 0"));
+    NDN_THROW(std::invalid_argument("FreshnessPeriod must be >= 0"));
   }
   m_wire.reset();
   m_freshnessPeriod = freshnessPeriod;
@@ -81,7 +81,7 @@
 {
   for (const auto& block : info) {
     if (block.type() < 128 || block.type() > 252)
-      BOOST_THROW_EXCEPTION(Error("AppMetaInfo block has type outside the application range [128, 252]"));
+      NDN_THROW(Error("AppMetaInfo block has type outside the application range [128, 252]"));
   }
 
   m_wire.reset();
@@ -93,8 +93,7 @@
 MetaInfo::addAppMetaInfo(const Block& block)
 {
   if (!(128 <= block.type() && block.type() <= 252))
-    BOOST_THROW_EXCEPTION(Error("AppMetaInfo block has type outside the application range "
-                                "[128, 252]"));
+    NDN_THROW(Error("AppMetaInfo block has type outside the application range [128, 252]"));
 
   m_wire.reset();
   m_appMetaInfo.push_back(block);
diff --git a/ndn-cxx/metadata-object.cpp b/ndn-cxx/metadata-object.cpp
index 78ad7f4..43212b6 100644
--- a/ndn-cxx/metadata-object.cpp
+++ b/ndn-cxx/metadata-object.cpp
@@ -21,8 +21,6 @@
 
 #include "ndn-cxx/metadata-object.hpp"
 
-#include <boost/lexical_cast.hpp>
-
 namespace ndn {
 
 static_assert(std::is_base_of<tlv::Error, MetadataObject::Error>::value,
@@ -35,14 +33,11 @@
 MetadataObject::MetadataObject(const Data& data)
 {
   if (data.getContentType() != tlv::ContentType_Blob) {
-    BOOST_THROW_EXCEPTION(Error("Expected ContentType to be BLOB but " +
-                                boost::lexical_cast<std::string>(data.getContentType()) +
-                                " is provided"));
+    NDN_THROW(Error("Expecting ContentType Blob, got " + to_string(data.getContentType())));
   }
 
   if (!isValidName(data.getName())) {
-    BOOST_THROW_EXCEPTION(Error("Name " + data.getName().toUri() +
-                                " is not a valid MetadataObject name"));
+    NDN_THROW(Error("Name " + data.getName().toUri() + " is not a valid MetadataObject name"));
   }
 
   data.getContent().parse();
@@ -58,8 +53,8 @@
                          time::milliseconds freshnessPeriod) const
 {
   if (discoveryInterestName.empty() || discoveryInterestName[-1] != KEYWORD_METADATA_COMP) {
-    BOOST_THROW_EXCEPTION(Error("Name " + discoveryInterestName.toUri() +
-                                " is not a valid discovery Interest name"));
+    NDN_THROW(Error("Name " + discoveryInterestName.toUri() +
+                    " is not a valid discovery Interest name"));
   }
   discoveryInterestName.appendVersion(version);
   discoveryInterestName.appendSegment(0);
diff --git a/ndn-cxx/mgmt/control-response.cpp b/ndn-cxx/mgmt/control-response.cpp
index d969d81..d0abdaf 100644
--- a/ndn-cxx/mgmt/control-response.cpp
+++ b/ndn-cxx/mgmt/control-response.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -73,17 +73,17 @@
   m_wire.parse();
 
   if (m_wire.type() != tlv::nfd::ControlResponse)
-    BOOST_THROW_EXCEPTION(Error("expected ControlResponse, got " + to_string(m_wire.type()) + " element"));
+    NDN_THROW(Error("ControlResponse", m_wire.type()));
 
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
   if (val == m_wire.elements_end() || val->type() != tlv::nfd::StatusCode) {
-    BOOST_THROW_EXCEPTION(Error("missing StatusCode sub-element"));
+    NDN_THROW(Error("missing StatusCode sub-element"));
   }
   m_code = readNonNegativeIntegerAs<uint32_t>(*val);
   ++val;
 
   if (val == m_wire.elements_end() || val->type() != tlv::nfd::StatusText) {
-    BOOST_THROW_EXCEPTION(Error("missing StatusText sub-element"));
+    NDN_THROW(Error("missing StatusText sub-element"));
   }
   m_text = readString(*val);
   ++val;
@@ -91,7 +91,7 @@
   if (val != m_wire.elements_end())
     m_body = *val;
   else
-    m_body = Block();
+    m_body = {};
 }
 
 std::ostream&
diff --git a/ndn-cxx/mgmt/dispatcher.cpp b/ndn-cxx/mgmt/dispatcher.cpp
index 326c511..306c7f3 100644
--- a/ndn-cxx/mgmt/dispatcher.cpp
+++ b/ndn-cxx/mgmt/dispatcher.cpp
@@ -63,7 +63,7 @@
                                   return x.first.isPrefixOf(prefix) || prefix.isPrefixOf(x.first);
                                 });
   if (hasOverlap) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("top-level prefix overlaps"));
+    NDN_THROW(std::out_of_range("top-level prefix overlaps"));
   }
 
   TopPrefixEntry& topPrefixEntry = m_topLevelPrefixes[prefix];
@@ -72,7 +72,7 @@
     topPrefixEntry.registeredPrefix = m_face.registerPrefix(prefix,
       nullptr,
       [] (const Name&, const std::string& reason) {
-        BOOST_THROW_EXCEPTION(std::runtime_error("prefix registration failed: " + reason));
+        NDN_THROW(std::runtime_error("prefix registration failed: " + reason));
       },
       signingInfo);
   }
@@ -225,11 +225,11 @@
                              StatusDatasetHandler handle)
 {
   if (!m_topLevelPrefixes.empty()) {
-    BOOST_THROW_EXCEPTION(std::domain_error("one or more top-level prefix has been added"));
+    NDN_THROW(std::domain_error("one or more top-level prefix has been added"));
   }
 
   if (isOverlappedWithOthers(relPrefix)) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("status dataset name overlaps"));
+    NDN_THROW(std::out_of_range("status dataset name overlaps"));
   }
 
   AuthorizationAcceptedCallback accepted =
@@ -300,11 +300,11 @@
 Dispatcher::addNotificationStream(const PartialName& relPrefix)
 {
   if (!m_topLevelPrefixes.empty()) {
-    BOOST_THROW_EXCEPTION(std::domain_error("one or more top-level prefix has been added"));
+    NDN_THROW(std::domain_error("one or more top-level prefix has been added"));
   }
 
   if (isOverlappedWithOthers(relPrefix)) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("notification stream name overlaps"));
+    NDN_THROW(std::out_of_range("notification stream name overlaps"));
   }
 
   // register a handler for the subscriber of this notification stream
diff --git a/ndn-cxx/mgmt/dispatcher.hpp b/ndn-cxx/mgmt/dispatcher.hpp
index c008b59..308e89a 100644
--- a/ndn-cxx/mgmt/dispatcher.hpp
+++ b/ndn-cxx/mgmt/dispatcher.hpp
@@ -463,11 +463,11 @@
                               ControlCommandHandler handle)
 {
   if (!m_topLevelPrefixes.empty()) {
-    BOOST_THROW_EXCEPTION(std::domain_error("one or more top-level prefix has been added"));
+    NDN_THROW(std::domain_error("one or more top-level prefix has been added"));
   }
 
   if (isOverlappedWithOthers(relPrefix)) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("relPrefix overlaps with another relPrefix"));
+    NDN_THROW(std::out_of_range("relPrefix overlaps with another relPrefix"));
   }
 
   auto parser = [] (const name::Component& comp) -> shared_ptr<ControlParameters> {
diff --git a/ndn-cxx/mgmt/nfd/channel-status.cpp b/ndn-cxx/mgmt/nfd/channel-status.cpp
index 6a79926..32d69a1 100644
--- a/ndn-cxx/mgmt/nfd/channel-status.cpp
+++ b/ndn-cxx/mgmt/nfd/channel-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -69,18 +69,19 @@
 ChannelStatus::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::ChannelStatus) {
-    BOOST_THROW_EXCEPTION(Error("Expecting ChannelStatus block"));
+    NDN_THROW(Error("ChannelStatus", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::LocalUri) {
     m_localUri = readString(*val);
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Missing required LocalUri field"));
+    NDN_THROW(Error("Missing required LocalUri field"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/nfd/command-options.cpp b/ndn-cxx/mgmt/nfd/command-options.cpp
index f0418c6..beeac16 100644
--- a/ndn-cxx/mgmt/nfd/command-options.cpp
+++ b/ndn-cxx/mgmt/nfd/command-options.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -37,7 +37,7 @@
 CommandOptions::setTimeout(const time::milliseconds& timeout)
 {
   if (timeout <= time::milliseconds::zero()) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("Timeout must be positive"));
+    NDN_THROW(std::out_of_range("Timeout must be positive"));
   }
 
   m_timeout = timeout;
diff --git a/ndn-cxx/mgmt/nfd/control-command.cpp b/ndn-cxx/mgmt/nfd/control-command.cpp
index c71d46c..86ca500 100644
--- a/ndn-cxx/mgmt/nfd/control-command.cpp
+++ b/ndn-cxx/mgmt/nfd/control-command.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -81,17 +81,17 @@
     bool isPresent = presentFields[i];
     if (m_required[i]) {
       if (!isPresent) {
-        BOOST_THROW_EXCEPTION(ArgumentError(CONTROL_PARAMETER_FIELD[i] + " is required but missing"));
+        NDN_THROW(ArgumentError(CONTROL_PARAMETER_FIELD[i] + " is required but missing"));
       }
     }
     else if (isPresent && !m_optional[i]) {
-      BOOST_THROW_EXCEPTION(ArgumentError(CONTROL_PARAMETER_FIELD[i] + " is forbidden but present"));
+      NDN_THROW(ArgumentError(CONTROL_PARAMETER_FIELD[i] + " is forbidden but present"));
     }
   }
 
   if (m_optional[CONTROL_PARAMETER_FLAGS] && m_optional[CONTROL_PARAMETER_MASK]) {
     if (parameters.hasFlags() != parameters.hasMask()) {
-      BOOST_THROW_EXCEPTION(ArgumentError("Flags must be accompanied by Mask"));
+      NDN_THROW(ArgumentError("Flags must be accompanied by Mask"));
     }
   }
 }
@@ -133,7 +133,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
@@ -169,7 +169,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
@@ -187,7 +187,7 @@
   this->ControlCommand::validateRequest(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
@@ -227,7 +227,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
@@ -256,7 +256,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
@@ -290,7 +290,7 @@
   this->ControlCommand::validateRequest(parameters);
 
   if (parameters.hasCount() && parameters.getCount() == 0) {
-    BOOST_THROW_EXCEPTION(ArgumentError("Count must be positive"));
+    NDN_THROW(ArgumentError("Count must be positive"));
   }
 }
 
@@ -300,7 +300,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.hasCapacity() && parameters.getCapacity() == 0) {
-    BOOST_THROW_EXCEPTION(ArgumentError("Capacity must be positive"));
+    NDN_THROW(ArgumentError("Capacity must be positive"));
   }
 }
 
@@ -327,7 +327,7 @@
   this->ControlCommand::validateRequest(parameters);
 
   if (parameters.getName().size() == 0) {
-    BOOST_THROW_EXCEPTION(ArgumentError("Name must not be ndn:/"));
+    NDN_THROW(ArgumentError("Name must not be ndn:/"));
   }
 }
 
@@ -379,7 +379,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
@@ -413,7 +413,7 @@
   this->ControlCommand::validateResponse(parameters);
 
   if (parameters.getFaceId() == INVALID_FACE_ID) {
-    BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid"));
+    NDN_THROW(ArgumentError("FaceId must be valid"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/nfd/control-parameters.cpp b/ndn-cxx/mgmt/nfd/control-parameters.cpp
index 86ca846..6c8f091 100644
--- a/ndn-cxx/mgmt/nfd/control-parameters.cpp
+++ b/ndn-cxx/mgmt/nfd/control-parameters.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -130,8 +130,9 @@
 ControlParameters::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::ControlParameters) {
-    BOOST_THROW_EXCEPTION(Error("Expecting TLV-TYPE ControlParameters"));
+    NDN_THROW(Error("ControlParameters", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
   Block::element_const_iterator val;
@@ -201,7 +202,7 @@
   if (this->hasStrategy()) {
     val->parse();
     if (val->elements().empty()) {
-      BOOST_THROW_EXCEPTION(Error("Expecting Strategy/Name"));
+      NDN_THROW(Error("Expecting Strategy/Name"));
     }
     else {
       m_strategy.wireDecode(*val->elements_begin());
@@ -243,7 +244,7 @@
 ControlParameters::hasFlagBit(size_t bit) const
 {
   if (bit >= 64) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("bit must be within range [0, 64)"));
+    NDN_THROW(std::out_of_range("bit must be within range [0, 64)"));
   }
 
   if (!hasMask()) {
@@ -257,7 +258,7 @@
 ControlParameters::getFlagBit(size_t bit) const
 {
   if (bit >= 64) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("bit must be within range [0, 64)"));
+    NDN_THROW(std::out_of_range("bit must be within range [0, 64)"));
   }
 
   if (!hasFlags()) {
@@ -271,7 +272,7 @@
 ControlParameters::setFlagBit(size_t bit, bool value, bool wantMask/* = true*/)
 {
   if (bit >= 64) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("bit must be within range [0, 64)"));
+    NDN_THROW(std::out_of_range("bit must be within range [0, 64)"));
   }
 
   uint64_t flags = hasFlags() ? getFlags() : 0;
@@ -296,7 +297,7 @@
 ControlParameters::unsetFlagBit(size_t bit)
 {
   if (bit >= 64) {
-    BOOST_THROW_EXCEPTION(std::out_of_range("bit must be within range [0, 64)"));
+    NDN_THROW(std::out_of_range("bit must be within range [0, 64)"));
   }
 
   uint64_t mask = hasMask() ? getMask() : 0;
diff --git a/ndn-cxx/mgmt/nfd/cs-info.cpp b/ndn-cxx/mgmt/nfd/cs-info.cpp
index 77cf819..9e6d29d 100644
--- a/ndn-cxx/mgmt/nfd/cs-info.cpp
+++ b/ndn-cxx/mgmt/nfd/cs-info.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -82,7 +82,7 @@
 CsInfo::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::CsInfo) {
-    BOOST_THROW_EXCEPTION(Error("expecting CsInfo block, got " + to_string(block.type())));
+    NDN_THROW(Error("CsInfo", block.type()));
   }
   m_wire = block;
   m_wire.parse();
@@ -93,7 +93,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Capacity field"));
+    NDN_THROW(Error("missing required Capacity field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Flags) {
@@ -101,7 +101,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Flags field"));
+    NDN_THROW(Error("missing required Flags field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NCsEntries) {
@@ -109,7 +109,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NCsEntries field"));
+    NDN_THROW(Error("missing required NCsEntries field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NHits) {
@@ -117,7 +117,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NHits field"));
+    NDN_THROW(Error("missing required NHits field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NMisses) {
@@ -125,7 +125,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NMisses field"));
+    NDN_THROW(Error("missing required NMisses field"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/nfd/face-event-notification.cpp b/ndn-cxx/mgmt/nfd/face-event-notification.cpp
index 5ca888c..09a7e05 100644
--- a/ndn-cxx/mgmt/nfd/face-event-notification.cpp
+++ b/ndn-cxx/mgmt/nfd/face-event-notification.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -83,18 +83,19 @@
 FaceEventNotification::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::FaceEventNotification) {
-    BOOST_THROW_EXCEPTION(Error("expecting FaceEventNotification block"));
+    NDN_THROW(Error("FaceEventNotification", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceEventKind) {
     m_kind = readNonNegativeIntegerAs<FaceEventKind>(*val);
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FaceEventKind field"));
+    NDN_THROW(Error("missing required FaceEventKind field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
@@ -102,7 +103,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FaceId field"));
+    NDN_THROW(Error("missing required FaceId field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Uri) {
@@ -110,7 +111,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Uri field"));
+    NDN_THROW(Error("missing required Uri field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::LocalUri) {
@@ -118,7 +119,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required LocalUri field"));
+    NDN_THROW(Error("missing required LocalUri field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceScope) {
@@ -126,7 +127,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FaceScope field"));
+    NDN_THROW(Error("missing required FaceScope field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FacePersistency) {
@@ -134,7 +135,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FacePersistency field"));
+    NDN_THROW(Error("missing required FacePersistency field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::LinkType) {
@@ -142,7 +143,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required LinkType field"));
+    NDN_THROW(Error("missing required LinkType field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Flags) {
@@ -150,7 +151,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Flags field"));
+    NDN_THROW(Error("missing required Flags field"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/nfd/face-query-filter.cpp b/ndn-cxx/mgmt/nfd/face-query-filter.cpp
index 2a77ade..a0f8e19 100644
--- a/ndn-cxx/mgmt/nfd/face-query-filter.cpp
+++ b/ndn-cxx/mgmt/nfd/face-query-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -104,14 +104,15 @@
 void
 FaceQueryFilter::wireDecode(const Block& block)
 {
-  // all fields are optional
   if (block.type() != tlv::nfd::FaceQueryFilter) {
-    BOOST_THROW_EXCEPTION(Error("expecting FaceQueryFilter block"));
+    NDN_THROW(Error("FaceQueryFilter", block.type()));
   }
 
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
+
+  // all fields are optional
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
     m_faceId = readNonNegativeInteger(*val);
diff --git a/ndn-cxx/mgmt/nfd/face-status.cpp b/ndn-cxx/mgmt/nfd/face-status.cpp
index a4acbab..8727b40 100644
--- a/ndn-cxx/mgmt/nfd/face-status.cpp
+++ b/ndn-cxx/mgmt/nfd/face-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -112,18 +112,19 @@
 FaceStatus::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::FaceStatus) {
-    BOOST_THROW_EXCEPTION(Error("expecting FaceStatus block"));
+    NDN_THROW(Error("FaceStatus", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
     m_faceId = readNonNegativeInteger(*val);
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FaceId field"));
+    NDN_THROW(Error("missing required FaceId field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Uri) {
@@ -131,7 +132,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Uri field"));
+    NDN_THROW(Error("missing required Uri field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::LocalUri) {
@@ -139,7 +140,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required LocalUri field"));
+    NDN_THROW(Error("missing required LocalUri field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::ExpirationPeriod) {
@@ -155,7 +156,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FaceScope field"));
+    NDN_THROW(Error("missing required FaceScope field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FacePersistency) {
@@ -163,7 +164,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FacePersistency field"));
+    NDN_THROW(Error("missing required FacePersistency field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::LinkType) {
@@ -171,7 +172,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required LinkType field"));
+    NDN_THROW(Error("missing required LinkType field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::BaseCongestionMarkingInterval) {
@@ -203,7 +204,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInInterests field"));
+    NDN_THROW(Error("missing required NInInterests field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInData) {
@@ -211,7 +212,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInData field"));
+    NDN_THROW(Error("missing required NInData field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInNacks) {
@@ -219,7 +220,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInNacks field"));
+    NDN_THROW(Error("missing required NInNacks field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutInterests) {
@@ -227,7 +228,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutInterests field"));
+    NDN_THROW(Error("missing required NOutInterests field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutData) {
@@ -235,7 +236,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutData field"));
+    NDN_THROW(Error("missing required NOutData field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutNacks) {
@@ -243,7 +244,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutNacks field"));
+    NDN_THROW(Error("missing required NOutNacks field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInBytes) {
@@ -251,7 +252,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInBytes field"));
+    NDN_THROW(Error("missing required NInBytes field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutBytes) {
@@ -259,7 +260,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutBytes field"));
+    NDN_THROW(Error("missing required NOutBytes field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Flags) {
@@ -267,7 +268,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Flags field"));
+    NDN_THROW(Error("missing required Flags field"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/nfd/face-traits.hpp b/ndn-cxx/mgmt/nfd/face-traits.hpp
index be07d16..f685e71 100644
--- a/ndn-cxx/mgmt/nfd/face-traits.hpp
+++ b/ndn-cxx/mgmt/nfd/face-traits.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -145,7 +145,7 @@
   getFlagBit(size_t bit) const
   {
     if (bit >= 64) {
-      BOOST_THROW_EXCEPTION(std::out_of_range("bit must be within range [0, 64)"));
+      NDN_THROW(std::out_of_range("bit must be within range [0, 64)"));
     }
     return m_flags & (1 << bit);
   }
@@ -154,7 +154,7 @@
   setFlagBit(size_t bit, bool value)
   {
     if (bit >= 64) {
-      BOOST_THROW_EXCEPTION(std::out_of_range("bit must be within range [0, 64)"));
+      NDN_THROW(std::out_of_range("bit must be within range [0, 64)"));
     }
 
     m_wire.reset();
diff --git a/ndn-cxx/mgmt/nfd/fib-entry.cpp b/ndn-cxx/mgmt/nfd/fib-entry.cpp
index 8989603..94154e3 100644
--- a/ndn-cxx/mgmt/nfd/fib-entry.cpp
+++ b/ndn-cxx/mgmt/nfd/fib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -96,26 +96,27 @@
 NextHopRecord::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::NextHopRecord) {
-    BOOST_THROW_EXCEPTION(Error("expecting NextHopRecord, but Block has type " + to_string(block.type())));
+    NDN_THROW(Error("NextHopRecord", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val == m_wire.elements_end()) {
-    BOOST_THROW_EXCEPTION(Error("unexpected end of NextHopRecord"));
+    NDN_THROW(Error("unexpected end of NextHopRecord"));
   }
   else if (val->type() != tlv::nfd::FaceId) {
-    BOOST_THROW_EXCEPTION(Error("expecting FaceId, but Block has type " + to_string(val->type())));
+    NDN_THROW(Error("FaceId", val->type()));
   }
   m_faceId = readNonNegativeInteger(*val);
   ++val;
 
   if (val == m_wire.elements_end()) {
-    BOOST_THROW_EXCEPTION(Error("unexpected end of NextHopRecord"));
+    NDN_THROW(Error("unexpected end of NextHopRecord"));
   }
   else if (val->type() != tlv::nfd::Cost) {
-    BOOST_THROW_EXCEPTION(Error("expecting Cost, but Block has type " + to_string(val->type())));
+    NDN_THROW(Error("Cost", val->type()));
   }
   m_cost = readNonNegativeInteger(*val);
   ++val;
@@ -208,17 +209,18 @@
 FibEntry::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::FibEntry) {
-    BOOST_THROW_EXCEPTION(Error("expecting FibEntry, but Block has type " + to_string(block.type())));
+    NDN_THROW(Error("FibEntry", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val == m_wire.elements_end()) {
-    BOOST_THROW_EXCEPTION(Error("unexpected end of FibEntry"));
+    NDN_THROW(Error("unexpected end of FibEntry"));
   }
   else if (val->type() != tlv::Name) {
-    BOOST_THROW_EXCEPTION(Error("expecting Name, but Block has type " + to_string(val->type())));
+    NDN_THROW(Error("Name", val->type()));
   }
   m_prefix.wireDecode(*val);
   ++val;
@@ -226,7 +228,7 @@
   m_nextHopRecords.clear();
   for (; val != m_wire.elements_end(); ++val) {
     if (val->type() != tlv::nfd::NextHopRecord) {
-      BOOST_THROW_EXCEPTION(Error("expecting NextHopRecord, but Block has type " + to_string(val->type())));
+      NDN_THROW(Error("NextHopRecord", val->type()));
     }
     m_nextHopRecords.emplace_back(*val);
   }
diff --git a/ndn-cxx/mgmt/nfd/fib-entry.hpp b/ndn-cxx/mgmt/nfd/fib-entry.hpp
index 4a74de2..74dd611 100644
--- a/ndn-cxx/mgmt/nfd/fib-entry.hpp
+++ b/ndn-cxx/mgmt/nfd/fib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -104,11 +104,7 @@
   class Error : public tlv::Error
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
+    using tlv::Error::Error;
   };
 
   FibEntry();
diff --git a/ndn-cxx/mgmt/nfd/forwarder-status.cpp b/ndn-cxx/mgmt/nfd/forwarder-status.cpp
index 067c5c5..fc00be1 100644
--- a/ndn-cxx/mgmt/nfd/forwarder-status.cpp
+++ b/ndn-cxx/mgmt/nfd/forwarder-status.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -104,18 +104,19 @@
 ForwarderStatus::wireDecode(const Block& block)
 {
   if (block.type() != tlv::Content) {
-    BOOST_THROW_EXCEPTION(Error("expecting Content block for Status payload"));
+    NDN_THROW(Error("Content", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NfdVersion) {
     m_nfdVersion = readString(*val);
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NfdVersion field"));
+    NDN_THROW(Error("missing required NfdVersion field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::StartTimestamp) {
@@ -123,7 +124,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required StartTimestamp field"));
+    NDN_THROW(Error("missing required StartTimestamp field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::CurrentTimestamp) {
@@ -131,7 +132,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required CurrentTimestamp field"));
+    NDN_THROW(Error("missing required CurrentTimestamp field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NNameTreeEntries) {
@@ -139,7 +140,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NNameTreeEntries field"));
+    NDN_THROW(Error("missing required NNameTreeEntries field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NFibEntries) {
@@ -147,7 +148,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NFibEntries field"));
+    NDN_THROW(Error("missing required NFibEntries field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NPitEntries) {
@@ -155,7 +156,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NPitEntries field"));
+    NDN_THROW(Error("missing required NPitEntries field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NMeasurementsEntries) {
@@ -163,7 +164,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NMeasurementsEntries field"));
+    NDN_THROW(Error("missing required NMeasurementsEntries field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NCsEntries) {
@@ -171,7 +172,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NCsEntries field"));
+    NDN_THROW(Error("missing required NCsEntries field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInInterests) {
@@ -179,7 +180,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInInterests field"));
+    NDN_THROW(Error("missing required NInInterests field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInData) {
@@ -187,7 +188,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInData field"));
+    NDN_THROW(Error("missing required NInData field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInNacks) {
@@ -195,7 +196,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NInNacks field"));
+    NDN_THROW(Error("missing required NInNacks field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutInterests) {
@@ -203,7 +204,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutInterests field"));
+    NDN_THROW(Error("missing required NOutInterests field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutData) {
@@ -211,7 +212,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutData field"));
+    NDN_THROW(Error("missing required NOutData field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NOutNacks) {
@@ -219,7 +220,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NOutNacks field"));
+    NDN_THROW(Error("missing required NOutNacks field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NSatisfiedInterests) {
@@ -227,7 +228,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NSatisfiedInterests field"));
+    NDN_THROW(Error("missing required NSatisfiedInterests field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NUnsatisfiedInterests) {
@@ -235,7 +236,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required NUnsatisfiedInterests field"));
+    NDN_THROW(Error("missing required NUnsatisfiedInterests field"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/nfd/rib-entry.cpp b/ndn-cxx/mgmt/nfd/rib-entry.cpp
index 9486b6b..f565acb 100644
--- a/ndn-cxx/mgmt/nfd/rib-entry.cpp
+++ b/ndn-cxx/mgmt/nfd/rib-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -140,18 +140,19 @@
 Route::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::Route) {
-    BOOST_THROW_EXCEPTION(Error("expecting Route, but Block has type " + to_string(block.type())));
+    NDN_THROW(Error("Route", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::FaceId) {
     m_faceId = readNonNegativeInteger(*val);
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required FaceId field"));
+    NDN_THROW(Error("missing required FaceId field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Origin) {
@@ -159,7 +160,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Origin field"));
+    NDN_THROW(Error("missing required Origin field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Cost) {
@@ -167,7 +168,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Cost field"));
+    NDN_THROW(Error("missing required Cost field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Flags) {
@@ -175,7 +176,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Flags field"));
+    NDN_THROW(Error("missing required Flags field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::ExpirationPeriod) {
@@ -287,17 +288,18 @@
 RibEntry::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::RibEntry) {
-    BOOST_THROW_EXCEPTION(Error("expecting RibEntry, but Block has type " + to_string(block.type())));
+    NDN_THROW(Error("RibEntry", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val == m_wire.elements_end()) {
-    BOOST_THROW_EXCEPTION(Error("unexpected end of RibEntry"));
+    NDN_THROW(Error("unexpected end of RibEntry"));
   }
   else if (val->type() != tlv::Name) {
-    BOOST_THROW_EXCEPTION(Error("expecting Name, but Block has type " + to_string(val->type())));
+    NDN_THROW(Error("Name", val->type()));
   }
   m_prefix.wireDecode(*val);
   ++val;
@@ -305,7 +307,7 @@
   m_routes.clear();
   for (; val != m_wire.elements_end(); ++val) {
     if (val->type() != tlv::nfd::Route) {
-      BOOST_THROW_EXCEPTION(Error("expecting Route, but Block has type " + to_string(val->type())));
+      NDN_THROW(Error("Route", val->type()));
     }
     m_routes.emplace_back(*val);
   }
diff --git a/ndn-cxx/mgmt/nfd/rib-entry.hpp b/ndn-cxx/mgmt/nfd/rib-entry.hpp
index a17daa1..2745be6 100644
--- a/ndn-cxx/mgmt/nfd/rib-entry.hpp
+++ b/ndn-cxx/mgmt/nfd/rib-entry.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -156,11 +156,7 @@
   class Error : public tlv::Error
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : tlv::Error(what)
-    {
-    }
+    using tlv::Error::Error;
   };
 
   RibEntry();
diff --git a/ndn-cxx/mgmt/nfd/status-dataset.cpp b/ndn-cxx/mgmt/nfd/status-dataset.cpp
index 4233181..3d2a3d3 100644
--- a/ndn-cxx/mgmt/nfd/status-dataset.cpp
+++ b/ndn-cxx/mgmt/nfd/status-dataset.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -67,7 +67,7 @@
     Block block;
     std::tie(isOk, block) = Block::fromBuffer(payload, offset);
     if (!isOk) {
-      BOOST_THROW_EXCEPTION(StatusDataset::ParseResultError("cannot decode Block"));
+      NDN_THROW(StatusDataset::ParseResultError("cannot decode Block"));
     }
 
     offset += block.size();
diff --git a/ndn-cxx/mgmt/nfd/strategy-choice.cpp b/ndn-cxx/mgmt/nfd/strategy-choice.cpp
index 1beb439..c2a7524 100644
--- a/ndn-cxx/mgmt/nfd/strategy-choice.cpp
+++ b/ndn-cxx/mgmt/nfd/strategy-choice.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -73,24 +73,25 @@
 StrategyChoice::wireDecode(const Block& block)
 {
   if (block.type() != tlv::nfd::StrategyChoice) {
-    BOOST_THROW_EXCEPTION(Error("expecting StrategyChoice block"));
+    NDN_THROW(Error("StrategyChoice", block.type()));
   }
+
   m_wire = block;
   m_wire.parse();
-  Block::element_const_iterator val = m_wire.elements_begin();
+  auto val = m_wire.elements_begin();
 
   if (val != m_wire.elements_end() && val->type() == tlv::Name) {
     m_name.wireDecode(*val);
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Name field"));
+    NDN_THROW(Error("missing required Name field"));
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::Strategy) {
     val->parse();
     if (val->elements().empty()) {
-      BOOST_THROW_EXCEPTION(Error("expecting Strategy/Name"));
+      NDN_THROW(Error("expecting Strategy/Name"));
     }
     else {
       m_strategy.wireDecode(*val->elements_begin());
@@ -98,7 +99,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required Strategy field"));
+    NDN_THROW(Error("missing required Strategy field"));
   }
 }
 
diff --git a/ndn-cxx/mgmt/status-dataset-context.cpp b/ndn-cxx/mgmt/status-dataset-context.cpp
index 2fe9356..0487061 100644
--- a/ndn-cxx/mgmt/status-dataset-context.cpp
+++ b/ndn-cxx/mgmt/status-dataset-context.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -36,11 +36,11 @@
 StatusDatasetContext::setPrefix(const Name& prefix)
 {
   if (!m_interest.getName().isPrefixOf(prefix)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("prefix does not start with Interest Name"));
+    NDN_THROW(std::invalid_argument("prefix does not start with Interest Name"));
   }
 
   if (m_state != State::INITIAL) {
-    BOOST_THROW_EXCEPTION(std::domain_error("state is not in INITIAL"));
+    NDN_THROW(std::domain_error("state is not in INITIAL"));
   }
 
   m_prefix = prefix;
@@ -69,7 +69,7 @@
 StatusDatasetContext::append(const Block& block)
 {
   if (m_state == State::FINALIZED) {
-    BOOST_THROW_EXCEPTION(std::domain_error("state is in FINALIZED"));
+    NDN_THROW(std::domain_error("state is in FINALIZED"));
   }
 
   m_state = State::RESPONDED;
@@ -95,11 +95,10 @@
 StatusDatasetContext::end()
 {
   if (m_state == State::FINALIZED) {
-    BOOST_THROW_EXCEPTION(std::domain_error("state is in FINALIZED"));
+    NDN_THROW(std::domain_error("state is in FINALIZED"));
   }
 
   m_state = State::FINALIZED;
-
   m_dataSender(Name(m_prefix).appendSegment(m_segmentNo),
                makeBinaryBlock(tlv::Content, m_buffer->buf(), m_buffer->size()),
                m_expiry, true);
@@ -109,7 +108,7 @@
 StatusDatasetContext::reject(const ControlResponse& resp /*= a ControlResponse with 400*/)
 {
   if (m_state != State::INITIAL) {
-    BOOST_THROW_EXCEPTION(std::domain_error("state is in REPONSED or FINALIZED"));
+    NDN_THROW(std::domain_error("state is in RESPONDED or FINALIZED"));
   }
 
   m_state = State::FINALIZED;
diff --git a/ndn-cxx/name-component.cpp b/ndn-cxx/name-component.cpp
index cbfe05d..beaf62f 100644
--- a/ndn-cxx/name-component.cpp
+++ b/ndn-cxx/name-component.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -44,7 +44,7 @@
 Component::ensureValid() const
 {
   if (type() < tlv::NameComponentMin || type() > tlv::NameComponentMax) {
-    BOOST_THROW_EXCEPTION(Error("TLV-TYPE " + to_string(type()) + " is not a valid NameComponent"));
+    NDN_THROW(Error("TLV-TYPE " + to_string(type()) + " is not a valid NameComponent"));
   }
   detail::getComponentTypeTable().get(type()).check(*this);
 }
@@ -91,7 +91,7 @@
   std::string value = oss.str();
   if (value.find_first_not_of('.') == std::string::npos) { // all periods
     if (value.size() < 3) {
-      BOOST_THROW_EXCEPTION(Component::Error("Illegal URI (name component cannot be . or ..)"));
+      NDN_THROW(Component::Error("Illegal URI (name component cannot be . or ..)"));
     }
     return Component(type, reinterpret_cast<const uint8_t*>(value.data()), value.size() - 3);
   }
@@ -117,7 +117,7 @@
   auto typePrefix = input.substr(0, equalPos);
   auto ct = detail::getComponentTypeTable().findByUriPrefix(typePrefix);
   if (ct == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Incorrect TLV-TYPE '" + typePrefix + "' in NameComponent URI"));
+    NDN_THROW(Error("Incorrect TLV-TYPE '" + typePrefix + "' in NameComponent URI"));
   }
   return ct->parseAltUriValue(input.substr(equalPos + 1));
 }
@@ -189,7 +189,7 @@
 Component::toNumber() const
 {
   if (!isNumber())
-    BOOST_THROW_EXCEPTION(Error("Name component does not have nonNegativeInteger value"));
+    NDN_THROW(Error("Name component does not have nonNegativeInteger value"));
 
   return readNonNegativeInteger(*this);
 }
@@ -198,8 +198,8 @@
 Component::toNumberWithMarker(uint8_t marker) const
 {
   if (!isNumberWithMarker(marker))
-    BOOST_THROW_EXCEPTION(Error("Name component does not have the requested marker "
-                                "or the value is not a nonNegativeInteger"));
+    NDN_THROW(Error("Name component does not have the requested marker "
+                    "or the value is not a nonNegativeInteger"));
 
   Buffer::const_iterator valueBegin = value_begin() + 1;
   return tlv::readNonNegativeInteger(value_size() - 1, valueBegin, value_end());
diff --git a/ndn-cxx/name.cpp b/ndn-cxx/name.cpp
index da6755f..5ea12cf 100644
--- a/ndn-cxx/name.cpp
+++ b/ndn-cxx/name.cpp
@@ -158,7 +158,7 @@
 Name::wireDecode(const Block& wire)
 {
   if (wire.type() != tlv::Name)
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV type when decoding Name"));
+    NDN_THROW(tlv::Error("Name", wire.type()));
 
   m_wire = wire;
   m_wire.parse();
@@ -183,7 +183,7 @@
   }
 
   if (i < 0 || static_cast<size_t>(i) >= size()) {
-    BOOST_THROW_EXCEPTION(Error("Requested component does not exist (out of bounds)"));
+    NDN_THROW(Error("Requested component does not exist (out of bounds)"));
   }
 
   return reinterpret_cast<const Component&>(m_wire.elements()[i]);
diff --git a/ndn-cxx/net/dns.cpp b/ndn-cxx/net/dns.cpp
index d398117..54d21e4 100644
--- a/ndn-cxx/net/dns.cpp
+++ b/ndn-cxx/net/dns.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -150,7 +150,7 @@
   auto it = resolver.syncResolve(Resolver::query(host, ""));
 
   if (it == Resolver::iterator()) {
-    BOOST_THROW_EXCEPTION(Error("No endpoints match the specified address selector"));
+    NDN_THROW(Error("No endpoints match the specified address selector"));
   }
 
   return it->endpoint().address();
diff --git a/ndn-cxx/net/face-uri.cpp b/ndn-cxx/net/face-uri.cpp
index c1bbe8b..65372dd 100644
--- a/ndn-cxx/net/face-uri.cpp
+++ b/ndn-cxx/net/face-uri.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California,
+ * Copyright (c) 2013-2019 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -50,7 +50,7 @@
 FaceUri::FaceUri(const std::string& uri)
 {
   if (!parse(uri)) {
-    BOOST_THROW_EXCEPTION(Error("Malformed URI: " + uri));
+    NDN_THROW(Error("Malformed URI: " + uri));
   }
 }
 
diff --git a/ndn-cxx/net/face-uri.hpp b/ndn-cxx/net/face-uri.hpp
index 650e7c7..d1fed76 100644
--- a/ndn-cxx/net/face-uri.hpp
+++ b/ndn-cxx/net/face-uri.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California,
+ * Copyright (c) 2013-2019 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -47,11 +47,7 @@
   class Error : public std::invalid_argument
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : std::invalid_argument(what)
-    {
-    }
+    using std::invalid_argument::invalid_argument;
   };
 
   FaceUri();
diff --git a/ndn-cxx/net/impl/netlink-socket.cpp b/ndn-cxx/net/impl/netlink-socket.cpp
index 9f9d4ef..6c60e6b 100644
--- a/ndn-cxx/net/impl/netlink-socket.cpp
+++ b/ndn-cxx/net/impl/netlink-socket.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -26,7 +26,6 @@
 #include "ndn-cxx/util/logger.hpp"
 #include "ndn-cxx/util/time.hpp"
 
-#include <cerrno>
 #include <linux/genetlink.h>
 #include <sys/socket.h>
 
@@ -63,7 +62,7 @@
 {
   int fd = ::socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol);
   if (fd < 0) {
-    BOOST_THROW_EXCEPTION(Error("Cannot create netlink socket ("s + std::strerror(errno) + ")"));
+    NDN_THROW_ERRNO(Error("Cannot create netlink socket"));
   }
   m_sock->assign(fd);
 
@@ -77,25 +76,25 @@
   // enable control messages for received packets to get the destination group
   const int one = 1;
   if (::setsockopt(fd, SOL_NETLINK, NETLINK_PKTINFO, &one, sizeof(one)) < 0) {
-    BOOST_THROW_EXCEPTION(Error("Cannot enable NETLINK_PKTINFO ("s + std::strerror(errno) + ")"));
+    NDN_THROW_ERRNO(Error("Cannot enable NETLINK_PKTINFO"));
   }
 
   sockaddr_nl addr{};
   addr.nl_family = AF_NETLINK;
   if (::bind(fd, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) < 0) {
-    BOOST_THROW_EXCEPTION(Error("Cannot bind netlink socket ("s + std::strerror(errno) + ")"));
+    NDN_THROW_ERRNO(Error("Cannot bind netlink socket"));
   }
 
   // find out what pid has been assigned to us
   socklen_t len = sizeof(addr);
   if (::getsockname(fd, reinterpret_cast<sockaddr*>(&addr), &len) < 0) {
-    BOOST_THROW_EXCEPTION(Error("Cannot obtain netlink socket address ("s + std::strerror(errno) + ")"));
+    NDN_THROW_ERRNO(Error("Cannot obtain netlink socket address"));
   }
   if (len != sizeof(addr)) {
-    BOOST_THROW_EXCEPTION(Error("Wrong address length (" + to_string(len) + ")"));
+    NDN_THROW(Error("Wrong address length (" + to_string(len) + ")"));
   }
   if (addr.nl_family != AF_NETLINK) {
-    BOOST_THROW_EXCEPTION(Error("Wrong address family (" + to_string(addr.nl_family) + ")"));
+    NDN_THROW(Error("Wrong address family (" + to_string(addr.nl_family) + ")"));
   }
   m_pid = addr.nl_pid;
   NDN_LOG_TRACE("our pid is " << m_pid);
@@ -114,8 +113,7 @@
 {
   if (::setsockopt(m_sock->native_handle(), SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
                    &group, sizeof(group)) < 0) {
-    BOOST_THROW_EXCEPTION(Error("Cannot join netlink group " + to_string(group) +
-                                " (" + std::strerror(errno) + ")"));
+    NDN_THROW_ERRNO(Error("Cannot join netlink group " + to_string(group)));
   }
 }
 
@@ -166,7 +164,7 @@
       }
       else if (ec) {
         NDN_LOG_ERROR("read failed: " << ec.message());
-        BOOST_THROW_EXCEPTION(Error("Netlink socket read error (" + ec.message() + ")"));
+        NDN_THROW(Error("Netlink socket read error (" + ec.message() + ")"));
       }
       else {
         receiveAndValidate();
@@ -194,21 +192,20 @@
 
   ssize_t nBytesRead = ::recvmsg(m_sock->native_handle(), &msg, 0);
   if (nBytesRead < 0) {
-    std::string errorString = std::strerror(errno);
     if (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK) {
       // not a fatal error
-      NDN_LOG_DEBUG("recvmsg failed: " << errorString);
+      NDN_LOG_DEBUG("recvmsg failed: " << std::strerror(errno));
       return;
     }
-    NDN_LOG_ERROR("recvmsg failed: " << errorString);
-    BOOST_THROW_EXCEPTION(Error("Netlink socket receive error (" + errorString + ")"));
+    NDN_LOG_ERROR("recvmsg failed: " << std::strerror(errno));
+    NDN_THROW_ERRNO(Error("Netlink socket receive error"));
   }
 
   NDN_LOG_TRACE("read " << nBytesRead << " bytes from netlink socket");
 
   if (msg.msg_flags & MSG_TRUNC) {
     NDN_LOG_ERROR("truncated message");
-    BOOST_THROW_EXCEPTION(Error("Received truncated netlink message"));
+    NDN_THROW(Error("Received truncated netlink message"));
     // TODO: grow the buffer and start over
   }
 
@@ -256,7 +253,7 @@
     }
     else if (nlmsg->nlmsg_flags & NLM_F_DUMP_INTR) {
       NDN_LOG_ERROR("dump is inconsistent");
-      BOOST_THROW_EXCEPTION(Error("Inconsistency detected in netlink dump"));
+      NDN_THROW(Error("Inconsistency detected in netlink dump"));
       // TODO: discard the rest of the message and retry the dump
     }
     else {
@@ -322,7 +319,7 @@
       }
       else if (ec != boost::asio::error::operation_aborted) {
         NDN_LOG_ERROR("write failed: " << ec.message());
-        BOOST_THROW_EXCEPTION(Error("Failed to send netlink request (" + ec.message() + ")"));
+        NDN_THROW(Error("Failed to send netlink request (" + ec.message() + ")"));
       }
   });
 }
@@ -433,7 +430,7 @@
       }
       else if (ec != boost::asio::error::operation_aborted) {
         NDN_LOG_ERROR("write failed: " << ec.message());
-        BOOST_THROW_EXCEPTION(Error("Failed to send netlink request (" + ec.message() + ")"));
+        NDN_THROW(Error("Failed to send netlink request (" + ec.message() + ")"));
       }
   });
 }
@@ -443,7 +440,7 @@
   , m_family(std::move(familyName))
 {
   if (m_family.size() >= GENL_NAMSIZ) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("netlink family name '" + m_family + "' too long"));
+    NDN_THROW(std::invalid_argument("netlink family name '" + m_family + "' too long"));
   }
 
   NDN_LOG_TRACE("resolving netlink family " << m_family);
diff --git a/ndn-cxx/net/impl/network-monitor-impl-osx.cpp b/ndn-cxx/net/impl/network-monitor-impl-osx.cpp
index 99f606f..f0866b8 100644
--- a/ndn-cxx/net/impl/network-monitor-impl-osx.cpp
+++ b/ndn-cxx/net/impl/network-monitor-impl-osx.cpp
@@ -81,7 +81,7 @@
   IfAddrs()
   {
     if (::getifaddrs(&m_ifaList) < 0) {
-      BOOST_THROW_EXCEPTION(NetworkMonitorImplOsx::Error("getifaddrs() failed: "s + strerror(errno)));
+      NDN_THROW_ERRNO(NetworkMonitorImplOsx::Error("getifaddrs() failed"));
     }
   }
 
@@ -140,7 +140,7 @@
   CFArrayAppendValue(patterns, CFSTR("State:/Network/Interface/.*/IPv6"));
 
   if (!SCDynamicStoreSetNotificationKeys(m_scStore.get(), nullptr, patterns)) {
-    BOOST_THROW_EXCEPTION(Error("SCDynamicStoreSetNotificationKeys failed"));
+    NDN_THROW(Error("SCDynamicStoreSetNotificationKeys failed"));
   }
 
   io.post([this] { enumerateInterfaces(); });
diff --git a/ndn-cxx/net/network-monitor-stub.cpp b/ndn-cxx/net/network-monitor-stub.cpp
index 25f8563..5dcc185 100644
--- a/ndn-cxx/net/network-monitor-stub.cpp
+++ b/ndn-cxx/net/network-monitor-stub.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -71,7 +71,7 @@
     BOOST_ASSERT(netif != nullptr);
     bool isNew = m_interfaces.emplace(netif->getName(), netif).second;
     if (!isNew) {
-      BOOST_THROW_EXCEPTION(std::invalid_argument("duplicate ifname"));
+      NDN_THROW(std::invalid_argument("duplicate ifname"));
     }
     this->emitSignal(onInterfaceAdded, netif);
   }
diff --git a/ndn-cxx/prefix-announcement.cpp b/ndn-cxx/prefix-announcement.cpp
index 6381cf6..da65e93 100644
--- a/ndn-cxx/prefix-announcement.cpp
+++ b/ndn-cxx/prefix-announcement.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -22,8 +22,6 @@
 #include "ndn-cxx/prefix-announcement.hpp"
 #include "ndn-cxx/encoding/tlv-nfd.hpp"
 
-#include <boost/lexical_cast.hpp>
-
 namespace ndn {
 
 static const name::Component KEYWORD_PA_COMP = "20025041"_block;
@@ -34,14 +32,14 @@
   : m_data(std::move(data))
 {
   if (m_data->getContentType() != tlv::ContentType_PrefixAnn) {
-    BOOST_THROW_EXCEPTION(Error("Data is not a prefix announcement: ContentType is " +
-                                boost::lexical_cast<std::string>(m_data->getContentType())));
+    NDN_THROW(Error("Data is not a prefix announcement: ContentType is " +
+                    to_string(m_data->getContentType())));
   }
 
   const Name& dataName = m_data->getName();
   if (dataName.size() < 3 || dataName[-3] != KEYWORD_PA_COMP ||
       !dataName[-2].isVersion() || !dataName[-1].isSegment()) {
-    BOOST_THROW_EXCEPTION(Error("Data is not a prefix announcement: wrong name structure"));
+    NDN_THROW(Error("Data is not a prefix announcement: wrong name structure"));
   }
   m_announcedName = dataName.getPrefix(-3);
 
@@ -58,8 +56,7 @@
   for (const Block& element : payload.elements()) {
     if (element.type() != tlv::nfd::ExpirationPeriod && element.type() != tlv::ValidityPeriod &&
         tlv::isCriticalType(element.type())) {
-      BOOST_THROW_EXCEPTION(Error("unrecognized element of critical type " +
-                                  to_string(element.type())));
+      NDN_THROW(Error("unrecognized element of critical type " + to_string(element.type())));
     }
   }
 }
@@ -102,7 +99,7 @@
 PrefixAnnouncement::setExpiration(time::milliseconds expiration)
 {
   if (expiration < 0_ms) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("expiration period is negative"));
+    NDN_THROW(std::invalid_argument("expiration period is negative"));
   }
   m_data.reset();
   m_expiration = expiration;
diff --git a/ndn-cxx/security/digest-sha256.cpp b/ndn-cxx/security/digest-sha256.cpp
index 36f6ae5..6332d1b 100644
--- a/ndn-cxx/security/digest-sha256.cpp
+++ b/ndn-cxx/security/digest-sha256.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -32,7 +32,7 @@
   : Signature(signature)
 {
   if (getType() != tlv::DigestSha256)
-    BOOST_THROW_EXCEPTION(Error("Cannot construct DigestSha256 from SignatureType " + to_string(getType())));
+    NDN_THROW(Error("Cannot construct DigestSha256 from SignatureType " + to_string(getType())));
 }
 
 } // namespace ndn
diff --git a/ndn-cxx/security/impl/openssl-helper.cpp b/ndn-cxx/security/impl/openssl-helper.cpp
index da4df1e..104723c 100644
--- a/ndn-cxx/security/impl/openssl-helper.cpp
+++ b/ndn-cxx/security/impl/openssl-helper.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -77,7 +77,7 @@
 #endif
 {
   if (m_ctx == nullptr)
-    BOOST_THROW_EXCEPTION(std::runtime_error("EVP_MD_CTX creation failed"));
+    NDN_THROW(std::runtime_error("EVP_MD_CTX creation failed"));
 }
 
 EvpMdCtx::~EvpMdCtx()
@@ -93,14 +93,14 @@
   : m_ctx(EVP_PKEY_CTX_new(key, nullptr))
 {
   if (m_ctx == nullptr)
-    BOOST_THROW_EXCEPTION(std::runtime_error("EVP_PKEY_CTX creation failed"));
+    NDN_THROW(std::runtime_error("EVP_PKEY_CTX creation failed"));
 }
 
 EvpPkeyCtx::EvpPkeyCtx(int id)
   : m_ctx(EVP_PKEY_CTX_new_id(id, nullptr))
 {
   if (m_ctx == nullptr)
-    BOOST_THROW_EXCEPTION(std::runtime_error("EVP_PKEY_CTX creation failed"));
+    NDN_THROW(std::runtime_error("EVP_PKEY_CTX creation failed"));
 }
 
 EvpPkeyCtx::~EvpPkeyCtx()
@@ -112,7 +112,7 @@
   : m_bio(BIO_new(method))
 {
   if (m_bio == nullptr)
-    BOOST_THROW_EXCEPTION(std::runtime_error("BIO creation failed"));
+    NDN_THROW(std::runtime_error("BIO creation failed"));
 }
 
 Bio::~Bio()
diff --git a/ndn-cxx/security/key-params.cpp b/ndn-cxx/security/key-params.cpp
index ec5325a..9d12bc8 100644
--- a/ndn-cxx/security/key-params.cpp
+++ b/ndn-cxx/security/key-params.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -53,7 +53,7 @@
 RsaKeyParamsInfo::checkKeySize(uint32_t size)
 {
   if (size < MIN_RSA_KEY_SIZE)
-    BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported RSA key size " + to_string(size)));
+    NDN_THROW(KeyParams::Error("Unsupported RSA key size " + to_string(size)));
   return size;
 }
 
@@ -70,7 +70,7 @@
     if (EC_KEY_SIZES[i] == size)
       return size;
   }
-  BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported EC key size " + to_string(size)));
+  NDN_THROW(KeyParams::Error("Unsupported EC key size " + to_string(size)));
 }
 
 uint32_t
@@ -86,7 +86,7 @@
     if (AES_KEY_SIZES[i] == size)
       return size;
   }
-  BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported AES key size " + to_string(size)));
+  NDN_THROW(KeyParams::Error("Unsupported AES key size " + to_string(size)));
 }
 
 uint32_t
diff --git a/ndn-cxx/security/pib/certificate-container.cpp b/ndn-cxx/security/pib/certificate-container.cpp
index f275869..a2a6762 100644
--- a/ndn-cxx/security/pib/certificate-container.cpp
+++ b/ndn-cxx/security/pib/certificate-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -116,8 +116,8 @@
 CertificateContainer::add(const v2::Certificate& certificate)
 {
   if (m_keyName != certificate.getKeyName())
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Certificate name `" + certificate.getKeyName().toUri() + "` "
-                                                "does not match key name"));
+    NDN_THROW(std::invalid_argument("Certificate name `" + certificate.getKeyName().toUri() + "` "
+                                    "does not match key name"));
 
   const Name& certName = certificate.getName();
   m_certNames.insert(certName);
@@ -130,8 +130,8 @@
 {
   if (!v2::Certificate::isValidName(certName) ||
       v2::extractKeyNameFromCertName(certName) != m_keyName) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
-                                                "is invalid or does not match key name"));
+    NDN_THROW(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
+                                    "is invalid or does not match key name"));
   }
 
   m_certNames.erase(certName);
@@ -149,8 +149,8 @@
 
   if (!v2::Certificate::isValidName(certName) ||
       v2::extractKeyNameFromCertName(certName) != m_keyName) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
-                                                "is invalid or does not match key name"));
+    NDN_THROW(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
+                                    "is invalid or does not match key name"));
   }
 
   m_certs[certName] = m_pib->getCertificate(certName);
diff --git a/ndn-cxx/security/pib/identity.cpp b/ndn-cxx/security/pib/identity.cpp
index 54a5f12..c9bd82b 100644
--- a/ndn-cxx/security/pib/identity.cpp
+++ b/ndn-cxx/security/pib/identity.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -92,7 +92,7 @@
   auto impl = m_impl.lock();
 
   if (impl == nullptr)
-    BOOST_THROW_EXCEPTION(std::domain_error("Invalid Identity instance"));
+    NDN_THROW(std::domain_error("Invalid Identity instance"));
 
   return impl;
 }
diff --git a/ndn-cxx/security/pib/impl/identity-impl.cpp b/ndn-cxx/security/pib/impl/identity-impl.cpp
index e9267ac..dd77a1b 100644
--- a/ndn-cxx/security/pib/impl/identity-impl.cpp
+++ b/ndn-cxx/security/pib/impl/identity-impl.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -40,7 +40,7 @@
     m_pib->addIdentity(m_name);
   }
   else if (!m_pib->hasIdentity(m_name)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Identity " + m_name.toUri() + " does not exist"));
+    NDN_THROW(Pib::Error("Identity " + m_name.toUri() + " does not exist"));
   }
 }
 
diff --git a/ndn-cxx/security/pib/impl/key-impl.cpp b/ndn-cxx/security/pib/impl/key-impl.cpp
index c2c8c32..79c0300 100644
--- a/ndn-cxx/security/pib/impl/key-impl.cpp
+++ b/ndn-cxx/security/pib/impl/key-impl.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -44,7 +44,7 @@
     publicKey.loadPkcs8(key, keyLen);
   }
   catch (const transform::PublicKey::Error&) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid key bits"));
+    NDN_THROW_NESTED(std::invalid_argument("Invalid key bits"));
   }
   m_keyType = publicKey.getKeyType();
 
diff --git a/ndn-cxx/security/pib/key-container.cpp b/ndn-cxx/security/pib/key-container.cpp
index d28b8d2..ccf3ad0 100644
--- a/ndn-cxx/security/pib/key-container.cpp
+++ b/ndn-cxx/security/pib/key-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -116,8 +116,8 @@
 KeyContainer::add(const uint8_t* key, size_t keyLen, const Name& keyName)
 {
   if (m_identity != v2::extractIdentityFromKeyName(keyName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Key name `" + keyName.toUri() + "` does not match identity "
-                                                "`" + m_identity.toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Key name `" + keyName.toUri() + "` does not match identity "
+                                    "`" + m_identity.toUri() + "`"));
   }
 
   m_keyNames.insert(keyName);
@@ -130,8 +130,8 @@
 KeyContainer::remove(const Name& keyName)
 {
   if (m_identity != v2::extractIdentityFromKeyName(keyName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Key name `" + keyName.toUri() + "` does not match identity "
-                                                "`" + m_identity.toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Key name `" + keyName.toUri() + "` does not match identity "
+                                    "`" + m_identity.toUri() + "`"));
   }
 
   m_keyNames.erase(keyName);
@@ -143,8 +143,8 @@
 KeyContainer::get(const Name& keyName) const
 {
   if (m_identity != v2::extractIdentityFromKeyName(keyName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Key name `" + keyName.toUri() + "` does not match identity "
-                                                "`" + m_identity.toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Key name `" + keyName.toUri() + "` does not match identity "
+                                    "`" + m_identity.toUri() + "`"));
   }
 
   shared_ptr<detail::KeyImpl> key;
diff --git a/ndn-cxx/security/pib/key.cpp b/ndn-cxx/security/pib/key.cpp
index 1b21aee..293effa 100644
--- a/ndn-cxx/security/pib/key.cpp
+++ b/ndn-cxx/security/pib/key.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -111,7 +111,7 @@
   auto impl = m_impl.lock();
 
   if (impl == nullptr) {
-    BOOST_THROW_EXCEPTION(std::domain_error("Invalid key instance"));
+    NDN_THROW(std::domain_error("Invalid key instance"));
   }
 
   return impl;
@@ -160,14 +160,13 @@
 extractIdentityFromKeyName(const Name& keyName)
 {
   if (!isValidKeyName(keyName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Key name `" + keyName.toUri() + "` "
-                                                "does not follow the naming conventions"));
+    NDN_THROW(std::invalid_argument("Key name `" + keyName.toUri() + "` "
+                                    "does not respect the naming conventions"));
   }
 
   return keyName.getPrefix(-Certificate::MIN_KEY_NAME_LENGTH); // trim everything after and including "KEY"
 }
 
 } // namespace v2
-
 } // namespace security
 } // namespace ndn
diff --git a/ndn-cxx/security/pib/pib-memory.cpp b/ndn-cxx/security/pib/pib-memory.cpp
index 94bd9f6..5e365cc 100644
--- a/ndn-cxx/security/pib/pib-memory.cpp
+++ b/ndn-cxx/security/pib/pib-memory.cpp
@@ -118,7 +118,7 @@
     return m_defaultIdentity;
   }
 
-  BOOST_THROW_EXCEPTION(Pib::Error("No default identity"));
+  NDN_THROW(Pib::Error("No default identity"));
 }
 
 bool
@@ -158,7 +158,7 @@
 PibMemory::getKeyBits(const Name& keyName) const
 {
   if (!hasKey(keyName)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Key `" + keyName.toUri() + "` not found"));
+    NDN_THROW(Pib::Error("Key `" + keyName.toUri() + "` not found"));
   }
 
   auto key = m_keys.find(keyName);
@@ -182,7 +182,7 @@
 PibMemory::setDefaultKeyOfIdentity(const Name& identity, const Name& keyName)
 {
   if (!hasKey(keyName)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Key `" + keyName.toUri() + "` not found"));
+    NDN_THROW(Pib::Error("Key `" + keyName.toUri() + "` not found"));
   }
 
   m_defaultKeys[identity] = keyName;
@@ -193,7 +193,7 @@
 {
   auto defaultKey = m_defaultKeys.find(identity);
   if (defaultKey == m_defaultKeys.end()) {
-    BOOST_THROW_EXCEPTION(Pib::Error("No default key for identity `" + identity.toUri() + "`"));
+    NDN_THROW(Pib::Error("No default key for identity `" + identity.toUri() + "`"));
   }
 
   return defaultKey->second;
@@ -234,7 +234,7 @@
 PibMemory::getCertificate(const Name& certName) const
 {
   if (!hasCertificate(certName)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Certificate `" + certName.toUri() +  "` does not exist"));
+    NDN_THROW(Pib::Error("Certificate `" + certName.toUri() +  "` does not exist"));
   }
 
   auto it = m_certs.find(certName);
@@ -257,7 +257,7 @@
 PibMemory::setDefaultCertificateOfKey(const Name& keyName, const Name& certName)
 {
   if (!hasCertificate(certName)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Certificate `" + certName.toUri() +  "` does not exist"));
+    NDN_THROW(Pib::Error("Certificate `" + certName.toUri() +  "` does not exist"));
   }
 
   m_defaultCerts[keyName] = certName;
@@ -268,7 +268,7 @@
 {
   auto it = m_defaultCerts.find(keyName);
   if (it == m_defaultCerts.end()) {
-    BOOST_THROW_EXCEPTION(Pib::Error("No default certificate for key `" + keyName.toUri() + "`"));
+    NDN_THROW(Pib::Error("No default certificate for key `" + keyName.toUri() + "`"));
   }
 
   auto certIt = m_certs.find(it->second);
diff --git a/ndn-cxx/security/pib/pib-sqlite3.cpp b/ndn-cxx/security/pib/pib-sqlite3.cpp
index ac6c552..e460c2e 100644
--- a/ndn-cxx/security/pib/pib-sqlite3.cpp
+++ b/ndn-cxx/security/pib/pib-sqlite3.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -82,7 +82,6 @@
     UPDATE identities SET is_default=0;
   END;
 
-
 CREATE TABLE IF NOT EXISTS
   keys(
     id                    INTEGER PRIMARY KEY,
@@ -222,18 +221,19 @@
                                );
 
   if (result != SQLITE_OK) {
-    BOOST_THROW_EXCEPTION(PibImpl::Error("PIB database cannot be opened/created in " + location));
+    NDN_THROW(PibImpl::Error("PIB database cannot be opened/created in " + dbDir.string()));
   }
 
   // enable foreign key
   sqlite3_exec(m_database, "PRAGMA foreign_keys=ON", nullptr, nullptr, nullptr);
 
   // initialize PIB tables
-  char* errorMessage = nullptr;
-  result = sqlite3_exec(m_database, INITIALIZATION.c_str(), nullptr, nullptr, &errorMessage);
-  if (result != SQLITE_OK && errorMessage != nullptr) {
-    sqlite3_free(errorMessage);
-    BOOST_THROW_EXCEPTION(PibImpl::Error("PIB DB cannot be initialized"));
+  char* errmsg = nullptr;
+  result = sqlite3_exec(m_database, INITIALIZATION.c_str(), nullptr, nullptr, &errmsg);
+  if (result != SQLITE_OK && errmsg != nullptr) {
+    std::string what = "PIB database cannot be initialized: "s + errmsg;
+    sqlite3_free(errmsg);
+    NDN_THROW(PibImpl::Error(what));
   }
 }
 
@@ -280,7 +280,7 @@
 {
   Sqlite3Statement statement(m_database, "SELECT id FROM identities WHERE identity=?");
   statement.bind(1, identity.wireEncode(), SQLITE_TRANSIENT);
-  return (statement.step() == SQLITE_ROW);
+  return statement.step() == SQLITE_ROW;
 }
 
 void
@@ -340,7 +340,7 @@
   if (statement.step() == SQLITE_ROW)
     return Name(statement.getBlock(0));
   else
-    BOOST_THROW_EXCEPTION(Pib::Error("No default identity"));
+    NDN_THROW(Pib::Error("No default identity"));
 }
 
 bool
@@ -405,7 +405,7 @@
   if (statement.step() == SQLITE_ROW)
     return Buffer(statement.getBlob(0), statement.getSize(0));
   else
-    BOOST_THROW_EXCEPTION(Pib::Error("Key `" + keyName.toUri() + "` does not exist"));
+    NDN_THROW(Pib::Error("Key `" + keyName.toUri() + "` does not exist"));
 }
 
 std::set<Name>
@@ -430,7 +430,7 @@
 PibSqlite3::setDefaultKeyOfIdentity(const Name& identity, const Name& keyName)
 {
   if (!hasKey(keyName)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Key `" + keyName.toUri() + "` does not exist"));
+    NDN_THROW(Pib::Error("Key `" + keyName.toUri() + "` does not exist"));
   }
 
   Sqlite3Statement statement(m_database, "UPDATE keys SET is_default=1 WHERE key_name=?");
@@ -442,7 +442,7 @@
 PibSqlite3::getDefaultKeyOfIdentity(const Name& identity) const
 {
   if (!hasIdentity(identity)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Identity `" + identity.toUri() + "` does not exist"));
+    NDN_THROW(Pib::Error("Identity `" + identity.toUri() + "` does not exist"));
   }
 
   Sqlite3Statement statement(m_database,
@@ -455,7 +455,7 @@
     return Name(statement.getBlock(0));
   }
   else
-    BOOST_THROW_EXCEPTION(Pib::Error("No default key for identity `" + identity.toUri() + "`"));
+    NDN_THROW(Pib::Error("No default key for identity `" + identity.toUri() + "`"));
 }
 
 bool
@@ -526,7 +526,7 @@
   if (statement.step() == SQLITE_ROW)
     return v2::Certificate(statement.getBlock(0));
   else
-    BOOST_THROW_EXCEPTION(Pib::Error("Certificate `" + certName.toUri() + "` does not exit"));
+    NDN_THROW(Pib::Error("Certificate `" + certName.toUri() + "` does not exit"));
 }
 
 std::set<Name>
@@ -550,7 +550,7 @@
 PibSqlite3::setDefaultCertificateOfKey(const Name& keyName, const Name& certName)
 {
   if (!hasCertificate(certName)) {
-    BOOST_THROW_EXCEPTION(Pib::Error("Certificate `" + certName.toUri() + "` does not exist"));
+    NDN_THROW(Pib::Error("Certificate `" + certName.toUri() + "` does not exist"));
   }
 
   Sqlite3Statement statement(m_database,
@@ -571,7 +571,7 @@
   if (statement.step() == SQLITE_ROW)
     return v2::Certificate(statement.getBlock(0));
   else
-    BOOST_THROW_EXCEPTION(Pib::Error("No default certificate for key `" + keyName.toUri() + "`"));
+    NDN_THROW(Pib::Error("No default certificate for key `" + keyName.toUri() + "`"));
 }
 
 bool
@@ -583,7 +583,7 @@
                              "WHERE certificates.is_default=1 AND keys.key_name=?");
   statement.bind(1, keyName.wireEncode(), SQLITE_TRANSIENT);
 
-  return (statement.step() == SQLITE_ROW);
+  return statement.step() == SQLITE_ROW;
 }
 
 } // namespace pib
diff --git a/ndn-cxx/security/pib/pib.cpp b/ndn-cxx/security/pib/pib.cpp
index ebf4256..a67bda5 100644
--- a/ndn-cxx/security/pib/pib.cpp
+++ b/ndn-cxx/security/pib/pib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -62,7 +62,7 @@
 {
   std::string tpmLocator = m_impl->getTpmLocator();
   if (tpmLocator.empty()) {
-    BOOST_THROW_EXCEPTION(Pib::Error("TPM info does not exist"));
+    NDN_THROW(Pib::Error("TPM info does not exist"));
   }
   return tpmLocator;
 }
diff --git a/ndn-cxx/security/safe-bag.cpp b/ndn-cxx/security/safe-bag.cpp
index b0d8abc..af7067c 100644
--- a/ndn-cxx/security/safe-bag.cpp
+++ b/ndn-cxx/security/safe-bag.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -87,40 +87,43 @@
   EncodingBuffer buffer(estimatedSize, 0);
   wireEncode(buffer);
 
-  this->m_wire = buffer.block();
+  m_wire = buffer.block();
   return m_wire;
 }
 
 void
 SafeBag::wireDecode(const Block& wire)
 {
-  if (wire.type() != tlv::security::SafeBag)
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV type when decoding safebag"));
+  if (wire.type() != tlv::security::SafeBag) {
+    NDN_THROW(tlv::Error("SafeBag", wire.type()));
+  }
 
-  this->m_wire = wire;
+  m_wire = wire;
   m_wire.parse();
-
-  Block::element_const_iterator it = m_wire.elements_begin();
+  auto it = m_wire.elements_begin();
 
   // Certificate must be the first part
   if (it != m_wire.elements_end()) {
-    this->m_certificate.wireDecode(*it);
+    m_certificate.wireDecode(*it);
     it++;
   }
-  else
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV structure when decoding certificate"));
+  else {
+    NDN_THROW(tlv::Error("Unexpected TLV structure when decoding Certificate"));
+  }
 
   // EncryptedKeyBag
   if (it != m_wire.elements_end() && it->type() == tlv::security::EncryptedKeyBag) {
-    this->m_encryptedKeyBag = Buffer(it->value(), it->value_size());
+    m_encryptedKeyBag = Buffer(it->value(), it->value_size());
     it++;
   }
-  else
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV structure when decoding encryptedkeybag"));
+  else {
+    NDN_THROW(tlv::Error("Unexpected TLV structure when decoding EncryptedKeyBag"));
+  }
 
   // Check if end
-  if (it != m_wire.elements_end())
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV structure after decoding the block"));
+  if (it != m_wire.elements_end()) {
+    NDN_THROW(tlv::Error("Unexpected TLV element at the end of SafeBag"));
+  }
 }
 
 } // namespace security
diff --git a/ndn-cxx/security/signature-sha256-with-ecdsa.cpp b/ndn-cxx/security/signature-sha256-with-ecdsa.cpp
index 2fc526a..4c92514 100644
--- a/ndn-cxx/security/signature-sha256-with-ecdsa.cpp
+++ b/ndn-cxx/security/signature-sha256-with-ecdsa.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -32,17 +32,17 @@
   : Signature(signature)
 {
   if (getType() != tlv::SignatureSha256WithEcdsa)
-    BOOST_THROW_EXCEPTION(Error("Cannot construct Sha256WithEcdsa from SignatureType " + to_string(getType())));
+    NDN_THROW(Error("Cannot construct Sha256WithEcdsa from SignatureType " + to_string(getType())));
 
   if (!hasKeyLocator()) {
-    BOOST_THROW_EXCEPTION(Error("KeyLocator is missing in Sha256WithEcdsa signature"));
+    NDN_THROW(Error("KeyLocator is missing in Sha256WithEcdsa signature"));
   }
 }
 
 void
 SignatureSha256WithEcdsa::unsetKeyLocator()
 {
-  BOOST_THROW_EXCEPTION(Error("KeyLocator cannot be unset in Sha256WithEcdsa signature"));
+  NDN_THROW(Error("KeyLocator cannot be unset in Sha256WithEcdsa signature"));
 }
 
 } // namespace ndn
diff --git a/ndn-cxx/security/signature-sha256-with-rsa.cpp b/ndn-cxx/security/signature-sha256-with-rsa.cpp
index 9b2e678..5fd1aed 100644
--- a/ndn-cxx/security/signature-sha256-with-rsa.cpp
+++ b/ndn-cxx/security/signature-sha256-with-rsa.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -32,17 +32,17 @@
   : Signature(signature)
 {
   if (getType() != tlv::SignatureSha256WithRsa)
-    BOOST_THROW_EXCEPTION(Error("Cannot construct Sha256WithRsa from SignatureType " + to_string(getType())));
+    NDN_THROW(Error("Cannot construct Sha256WithRsa from SignatureType " + to_string(getType())));
 
   if (!hasKeyLocator()) {
-    BOOST_THROW_EXCEPTION(Error("KeyLocator is missing in Sha256WithRsa signature"));
+    NDN_THROW(Error("KeyLocator is missing in Sha256WithRsa signature"));
   }
 }
 
 void
 SignatureSha256WithRsa::unsetKeyLocator()
 {
-  BOOST_THROW_EXCEPTION(Error("KeyLocator cannot be unset in Sha256WithRsa signature"));
+  NDN_THROW(Error("KeyLocator cannot be unset in Sha256WithRsa signature"));
 }
 
 } // namespace ndn
diff --git a/ndn-cxx/security/signing-info.cpp b/ndn-cxx/security/signing-info.cpp
index ed760f0..848bdeb 100644
--- a/ndn-cxx/security/signing-info.cpp
+++ b/ndn-cxx/security/signing-info.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -81,7 +81,7 @@
 
   size_t pos = signingStr.find(':');
   if (pos == std::string::npos) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid signing string cannot represent SigningInfo"));
+    NDN_THROW(std::invalid_argument("Invalid signing string cannot represent SigningInfo"));
   }
 
   std::string scheme = signingStr.substr(0, pos);
@@ -102,7 +102,7 @@
     setSigningCertName(nameArg);
   }
   else {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid signing string scheme"));
+    NDN_THROW(std::invalid_argument("Invalid signing string scheme"));
   }
 }
 
@@ -181,7 +181,7 @@
       return os << "id:" << SigningInfo::getDigestSha256Identity();
   }
 
-  BOOST_THROW_EXCEPTION(std::invalid_argument("Unknown signer type"));
+  NDN_THROW(std::invalid_argument("Unknown signer type"));
   return os;
 }
 
diff --git a/ndn-cxx/security/tpm/back-end-file.cpp b/ndn-cxx/security/tpm/back-end-file.cpp
index 6f1af3b..22783ae 100644
--- a/ndn-cxx/security/tpm/back-end-file.cpp
+++ b/ndn-cxx/security/tpm/back-end-file.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -128,8 +128,8 @@
     saveKey(keyHandle->getKeyName(), *key);
     return keyHandle;
   }
-  catch (const std::runtime_error& e) {
-    BOOST_THROW_EXCEPTION(Error("Cannot write key to file: "s + e.what()));
+  catch (const std::runtime_error&) {
+    NDN_THROW_NESTED(Error("Cannot write key to file"));
   }
 }
 
@@ -143,8 +143,8 @@
   try {
     boost::filesystem::remove(keyPath);
   }
-  catch (const boost::filesystem::filesystem_error& e) {
-    BOOST_THROW_EXCEPTION(Error("Cannot remove key file: "s + e.what()));
+  catch (const boost::filesystem::filesystem_error&) {
+    NDN_THROW_NESTED(Error("Cannot remove key file"));
   }
 }
 
@@ -155,8 +155,8 @@
   try {
     key = loadKey(keyName);
   }
-  catch (const PrivateKey::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Cannot export private key: "s + e.what()));
+  catch (const PrivateKey::Error&) {
+    NDN_THROW_NESTED(Error("Cannot export private key"));
   }
 
   OBufferStream os;
@@ -172,8 +172,8 @@
     key.loadPkcs8(buf, size, pw, pwLen);
     saveKey(keyName, key);
   }
-  catch (const PrivateKey::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Cannot import private key: "s + e.what()));
+  catch (const PrivateKey::Error&) {
+    NDN_THROW_NESTED(Error("Cannot import private key"));
   }
 }
 
diff --git a/ndn-cxx/security/tpm/back-end-mem.cpp b/ndn-cxx/security/tpm/back-end-mem.cpp
index c6ec080..68e49d9 100644
--- a/ndn-cxx/security/tpm/back-end-mem.cpp
+++ b/ndn-cxx/security/tpm/back-end-mem.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -101,8 +101,8 @@
     key->loadPkcs8(buf, size, pw, pwLen);
     m_impl->keys[keyName] = key;
   }
-  catch (const PrivateKey::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Cannot import private key: "s + e.what()));
+  catch (const PrivateKey::Error&) {
+    NDN_THROW_NESTED(Error("Cannot import private key"));
   }
 }
 
diff --git a/ndn-cxx/security/tpm/back-end-osx.cpp b/ndn-cxx/security/tpm/back-end-osx.cpp
index 92ff4b1..9e28aab 100644
--- a/ndn-cxx/security/tpm/back-end-osx.cpp
+++ b/ndn-cxx/security/tpm/back-end-osx.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -86,7 +86,7 @@
   case KeyType::EC:
     return kSecAttrKeyTypeECDSA;
   default:
-    BOOST_THROW_EXCEPTION(Tpm::Error("Unsupported key type"));
+    NDN_THROW(Tpm::Error("Unsupported key type"));
   }
 }
 
@@ -147,7 +147,7 @@
     return nullptr;
   }
   else {
-    BOOST_THROW_EXCEPTION(BackEnd::Error("Key lookup in keychain failed: " + getErrorMessage(res)));
+    NDN_THROW(BackEnd::Error("Key lookup in keychain failed: " + getErrorMessage(res)));
   }
 }
 
@@ -174,7 +174,7 @@
                                &exportedKey.get());    // exportedData
 
   if (res != errSecSuccess) {
-    BOOST_THROW_EXCEPTION(BackEnd::Error("Failed to export private key: "s + getErrorMessage(res)));
+    NDN_THROW(BackEnd::Error("Failed to export private key: "s + getErrorMessage(res)));
   }
 
   outKey.loadPkcs8(CFDataGetBytePtr(exportedKey.get()), CFDataGetLength(exportedKey.get()),
@@ -188,7 +188,7 @@
 
   OSStatus res = SecKeychainCopyDefault(&m_impl->keyChainRef);
   if (res == errSecNoDefaultKeychain) {
-    BOOST_THROW_EXCEPTION(Error("No default keychain, create one first"));
+    NDN_THROW(Error("No default keychain, create one first"));
   }
 }
 
@@ -250,29 +250,26 @@
   CFReleaser<CFErrorRef> error;
   CFReleaser<SecTransformRef> signer = SecSignTransformCreate(key.get(), &error.get());
   if (signer == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to create sign transform: " + getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to create sign transform: " + getFailureReason(error.get())));
   }
 
   // Set input
   auto data = makeCFDataNoCopy(buf, size);
   SecTransformSetAttribute(signer.get(), kSecTransformInputAttributeName, data.get(), &error.get());
   if (error != nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to configure input of sign transform: " +
-                                getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to configure input of sign transform: " + getFailureReason(error.get())));
   }
 
   // Enable use of padding
   SecTransformSetAttribute(signer.get(), kSecPaddingKey, kSecPaddingPKCS1Key, &error.get());
   if (error != nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to configure padding of sign transform: " +
-                                getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to configure padding of sign transform: " + getFailureReason(error.get())));
   }
 
   // Set digest type
   SecTransformSetAttribute(signer.get(), kSecDigestTypeAttribute, getDigestAlgorithm(digestAlgo), &error.get());
   if (error != nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to configure digest type of sign transform: " +
-                                getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to configure digest type of sign transform: " + getFailureReason(error.get())));
   }
 
   // Set digest length
@@ -280,15 +277,14 @@
   CFReleaser<CFNumberRef> cfDigestSize = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &digestSize);
   SecTransformSetAttribute(signer.get(), kSecDigestLengthAttribute, cfDigestSize.get(), &error.get());
   if (error != nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to configure digest length of sign transform: " +
-                                getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to configure digest length of sign transform: " + getFailureReason(error.get())));
   }
 
   // Actually sign
   // C-style cast is used as per Apple convention
   CFReleaser<CFDataRef> signature = (CFDataRef)SecTransformExecute(signer.get(), &error.get());
   if (signature == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to sign data: " + getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to sign data: " + getFailureReason(error.get())));
   }
 
   return make_shared<Buffer>(CFDataGetBytePtr(signature.get()), CFDataGetLength(signature.get()));
@@ -300,26 +296,24 @@
   CFReleaser<CFErrorRef> error;
   CFReleaser<SecTransformRef> decryptor = SecDecryptTransformCreate(key.get(), &error.get());
   if (decryptor == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to create decrypt transform: " + getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to create decrypt transform: " + getFailureReason(error.get())));
   }
 
   auto data = makeCFDataNoCopy(cipherText, cipherSize);
   SecTransformSetAttribute(decryptor.get(), kSecTransformInputAttributeName, data.get(), &error.get());
   if (error != nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to configure input of decrypt transform: " +
-                                getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to configure input of decrypt transform: " + getFailureReason(error.get())));
   }
 
   SecTransformSetAttribute(decryptor.get(), kSecPaddingKey, kSecPaddingOAEPKey, &error.get());
   if (error != nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to configure padding of decrypt transform: " +
-                                getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to configure padding of decrypt transform: " + getFailureReason(error.get())));
   }
 
   // C-style cast is used as per Apple convention
   CFReleaser<CFDataRef> plainText = (CFDataRef)SecTransformExecute(decryptor.get(), &error.get());
   if (plainText == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to decrypt data: " + getFailureReason(error.get())));
+    NDN_THROW(Error("Failed to decrypt data: " + getFailureReason(error.get())));
   }
 
   return make_shared<Buffer>(CFDataGetBytePtr(plainText.get()), CFDataGetLength(plainText.get()));
@@ -367,7 +361,7 @@
       break;
     }
     default: {
-      BOOST_THROW_EXCEPTION(Tpm::Error("Failed to generate key pair: Unsupported key type"));
+      NDN_THROW(Tpm::Error("Failed to generate key pair: Unsupported key type"));
     }
   }
   CFReleaser<CFNumberRef> cfKeySize = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &keySize);
@@ -382,7 +376,7 @@
   privateKey.retain();
 
   if (res != errSecSuccess) {
-    BOOST_THROW_EXCEPTION(Error("Failed to generate key pair: " + getErrorMessage(res)));
+    NDN_THROW(Error("Failed to generate key pair: " + getErrorMessage(res)));
   }
 
   unique_ptr<KeyHandle> keyHandle = make_unique<KeyHandleOsx>(privateKey.get());
@@ -417,7 +411,7 @@
   OSStatus res = SecItemDelete(query.get());
 
   if (res != errSecSuccess && res != errSecItemNotFound) {
-    BOOST_THROW_EXCEPTION(Error("Failed to delete key pair: " + getErrorMessage(res)));
+    NDN_THROW(Error("Failed to delete key pair: " + getErrorMessage(res)));
   }
 }
 
@@ -426,7 +420,7 @@
 {
   KeyRefOsx keychainItem = getKeyRef(keyName);
   if (keychainItem == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Failed to export private key: " + getErrorMessage(errSecItemNotFound)));
+    NDN_THROW(Error("Failed to export private key: " + getErrorMessage(errSecItemNotFound)));
   }
 
   transform::PrivateKey exportedKey;
@@ -435,8 +429,8 @@
     exportItem(keychainItem, exportedKey);
     exportedKey.savePkcs8(pkcs8, pw, pwLen);
   }
-  catch (const transform::PrivateKey::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Failed to export private key: "s + e.what()));
+  catch (const transform::PrivateKey::Error&) {
+    NDN_THROW_NESTED(Error("Failed to export private key"));
   }
   return pkcs8.buf();
 }
@@ -452,8 +446,8 @@
     privKey.loadPkcs8(buf, size, pw, pwLen);
     privKey.savePkcs1(pkcs1);
   }
-  catch (const transform::PrivateKey::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Failed to import private key: "s + e.what()));
+  catch (const transform::PrivateKey::Error&) {
+    NDN_THROW_NESTED(Error("Failed to import private key"));
   }
   auto keyToImport = makeCFDataNoCopy(pkcs1.buf()->data(), pkcs1.buf()->size());
 
@@ -468,7 +462,7 @@
                                  &access.get()); // accessRef
 
   if (res != errSecSuccess) {
-    BOOST_THROW_EXCEPTION(Error("Failed to import private key: " + getErrorMessage(res)));
+    NDN_THROW(Error("Failed to import private key: " + getErrorMessage(res)));
   }
 
   SecItemImportExportKeyParameters keyParams;
@@ -487,7 +481,7 @@
                       &outItems.get());    // outItems
 
   if (res != errSecSuccess) {
-    BOOST_THROW_EXCEPTION(Error("Failed to import private key: " + getErrorMessage(res)));
+    NDN_THROW(Error("Failed to import private key: " + getErrorMessage(res)));
   }
 
   // C-style cast is used as per Apple convention
diff --git a/ndn-cxx/security/tpm/back-end.cpp b/ndn-cxx/security/tpm/back-end.cpp
index 83ae426..8c54a1c 100644
--- a/ndn-cxx/security/tpm/back-end.cpp
+++ b/ndn-cxx/security/tpm/back-end.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -55,7 +55,7 @@
     case KeyIdType::USER_SPECIFIED: { // keyId is pre-set.
       Name keyName = v2::constructKeyName(identity, params.getKeyId());
       if (hasKey(keyName)) {
-        BOOST_THROW_EXCEPTION(Tpm::Error("Key `" + keyName.toUri() + "` already exists"));
+        NDN_THROW(Tpm::Error("Key `" + keyName.toUri() + "` already exists"));
       }
       break;
     }
@@ -75,7 +75,7 @@
       break;
     }
     default: {
-      BOOST_THROW_EXCEPTION(Error("Unsupported key id type"));
+      NDN_THROW(Error("Unsupported key id type"));
     }
   }
 
@@ -92,7 +92,7 @@
 BackEnd::exportKey(const Name& keyName, const char* pw, size_t pwLen)
 {
   if (!hasKey(keyName)) {
-    BOOST_THROW_EXCEPTION(Error("Key `" + keyName.toUri() + "` does not exist"));
+    NDN_THROW(Error("Key `" + keyName.toUri() + "` does not exist"));
   }
   return doExportKey(keyName, pw, pwLen);
 }
@@ -101,7 +101,7 @@
 BackEnd::importKey(const Name& keyName, const uint8_t* pkcs8, size_t pkcs8Len, const char* pw, size_t pwLen)
 {
   if (hasKey(keyName)) {
-    BOOST_THROW_EXCEPTION(Error("Key `" + keyName.toUri() + "` already exists"));
+    NDN_THROW(Error("Key `" + keyName.toUri() + "` already exists"));
   }
   doImportKey(keyName, pkcs8, pkcs8Len, pw, pwLen);
 }
@@ -131,7 +131,7 @@
       break;
     }
     default: {
-      BOOST_THROW_EXCEPTION(Error("Unsupported key id type"));
+      NDN_THROW(Error("Unsupported key id type"));
     }
   }
 
diff --git a/ndn-cxx/security/tpm/key-handle-osx.cpp b/ndn-cxx/security/tpm/key-handle-osx.cpp
index 7172455..0421327 100644
--- a/ndn-cxx/security/tpm/key-handle-osx.cpp
+++ b/ndn-cxx/security/tpm/key-handle-osx.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -30,7 +30,7 @@
   : m_key(key)
 {
   if (m_key.get() == 0)
-    BOOST_THROW_EXCEPTION(Error("key is not set"));
+    NDN_THROW(Error("Key is not set"));
 }
 
 ConstBufferPtr
diff --git a/ndn-cxx/security/tpm/tpm.cpp b/ndn-cxx/security/tpm/tpm.cpp
index ecbf48f..87c1c84 100644
--- a/ndn-cxx/security/tpm/tpm.cpp
+++ b/ndn-cxx/security/tpm/tpm.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,6 +23,8 @@
 #include "ndn-cxx/security/tpm/back-end.hpp"
 #include "ndn-cxx/encoding/buffer-stream.hpp"
 
+#include <boost/lexical_cast.hpp>
+
 namespace ndn {
 namespace security {
 namespace tpm {
@@ -60,7 +62,8 @@
       return keyName;
     }
     default: {
-      BOOST_THROW_EXCEPTION(Error("Fail to create a key pair: Unsupported key type"));
+      NDN_THROW(Error("Failed to create key pair: Unsupported key type " +
+                      boost::lexical_cast<std::string>(params.getKeyType())));
     }
   }
 }
diff --git a/ndn-cxx/security/transform/base64-decode.cpp b/ndn-cxx/security/transform/base64-decode.cpp
index 7e47519..5b4de25 100644
--- a/ndn-cxx/security/transform/base64-decode.cpp
+++ b/ndn-cxx/security/transform/base64-decode.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -86,7 +86,7 @@
   if (wLen <= 0) { // fail to write data
     if (!BIO_should_retry(m_impl->m_source)) {
       // we haven't written everything but some error happens, and we cannot retry
-      BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+      NDN_THROW(Error(getIndex(), "Failed to accept more input"));
     }
     return 0;
   }
diff --git a/ndn-cxx/security/transform/base64-encode.cpp b/ndn-cxx/security/transform/base64-encode.cpp
index 0400de2..f581300 100644
--- a/ndn-cxx/security/transform/base64-encode.cpp
+++ b/ndn-cxx/security/transform/base64-encode.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -77,7 +77,7 @@
   if (wLen <= 0) { // fail to write data
     if (!BIO_should_retry(m_impl->m_base64)) {
       // we haven't written everything but some error happens, and we cannot retry
-      BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+      NDN_THROW(Error(getIndex(), "Failed to accept more input"));
     }
     return 0;
   }
@@ -91,7 +91,7 @@
 Base64Encode::finalize()
 {
   if (BIO_flush(m_impl->m_base64) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to flush"));
+    NDN_THROW(Error(getIndex(), "Failed to flush"));
 
   while (!isConverterEmpty()) {
     fillOutputBuffer();
diff --git a/ndn-cxx/security/transform/block-cipher.cpp b/ndn-cxx/security/transform/block-cipher.cpp
index a9bee3a..950099e 100644
--- a/ndn-cxx/security/transform/block-cipher.cpp
+++ b/ndn-cxx/security/transform/block-cipher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -59,8 +59,8 @@
     initializeAesCbc(key, keyLen, iv, ivLen, op);
     break;
   default:
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported block cipher algorithm " +
-                                boost::lexical_cast<std::string>(algo)));
+    NDN_THROW(Error(getIndex(), "Unsupported block cipher algorithm " +
+                    boost::lexical_cast<std::string>(algo)));
   }
 }
 
@@ -83,7 +83,7 @@
   if (wLen <= 0) { // failed to write data
     if (!BIO_should_retry(m_impl->m_cipher)) {
       // we haven't written everything but some error happens, and we cannot retry
-      BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+      NDN_THROW(Error(getIndex(), "Failed to accept more input"));
     }
     return 0;
   }
@@ -97,7 +97,7 @@
 BlockCipher::finalize()
 {
   if (BIO_flush(m_impl->m_cipher) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to flush"));
+    NDN_THROW(Error(getIndex(), "Failed to flush"));
 
   while (!isConverterEmpty()) {
     fillOutputBuffer();
@@ -146,12 +146,12 @@
     cipherType = EVP_aes_256_cbc();
     break;
   default:
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported key length " + to_string(keyLen)));
+    NDN_THROW(Error(getIndex(), "Unsupported key length " + to_string(keyLen)));
   }
 
   size_t requiredIvLen = static_cast<size_t>(EVP_CIPHER_iv_length(cipherType));
   if (ivLen != requiredIvLen)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "IV length must be " + to_string(requiredIvLen)));
+    NDN_THROW(Error(getIndex(), "IV length must be " + to_string(requiredIvLen)));
 
   BIO_set_cipher(m_impl->m_cipher, cipherType, key, iv, static_cast<int>(op));
 }
diff --git a/ndn-cxx/security/transform/digest-filter.cpp b/ndn-cxx/security/transform/digest-filter.cpp
index b0066b2..2293739 100644
--- a/ndn-cxx/security/transform/digest-filter.cpp
+++ b/ndn-cxx/security/transform/digest-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -40,12 +40,10 @@
 {
   const EVP_MD* md = detail::digestAlgorithmToEvpMd(algo);
   if (md == nullptr)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported digest algorithm " +
-                                boost::lexical_cast<std::string>(algo)));
+    NDN_THROW(Error(getIndex(), "Unsupported digest algorithm " + boost::lexical_cast<std::string>(algo)));
 
   if (EVP_DigestInit_ex(m_impl->ctx, md, nullptr) == 0)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Cannot initialize digest " +
-                                boost::lexical_cast<std::string>(algo)));
+    NDN_THROW(Error(getIndex(), "Cannot initialize digest " + boost::lexical_cast<std::string>(algo)));
 }
 
 DigestFilter::~DigestFilter() = default;
@@ -54,7 +52,7 @@
 DigestFilter::convert(const uint8_t* buf, size_t size)
 {
   if (EVP_DigestUpdate(m_impl->ctx, buf, size) == 0)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+    NDN_THROW(Error(getIndex(), "Failed to accept more input"));
 
   return size;
 }
@@ -66,7 +64,7 @@
   unsigned int mdLen = 0;
 
   if (EVP_DigestFinal_ex(m_impl->ctx, buffer->data(), &mdLen) == 0)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to finalize digest"));
+    NDN_THROW(Error(getIndex(), "Failed to finalize digest"));
 
   buffer->erase(buffer->begin() + mdLen, buffer->end());
   setOutputBuffer(std::move(buffer));
diff --git a/ndn-cxx/security/transform/hex-decode.cpp b/ndn-cxx/security/transform/hex-decode.cpp
index 0543319..9a91ee6 100644
--- a/ndn-cxx/security/transform/hex-decode.cpp
+++ b/ndn-cxx/security/transform/hex-decode.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -77,7 +77,7 @@
 HexDecode::finalize()
 {
   if (m_hasOddByte)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Incomplete input"));
+    NDN_THROW(Error(getIndex(), "Incomplete input"));
 }
 
 unique_ptr<Transform::OBuffer>
@@ -89,7 +89,7 @@
 
   if (m_hasOddByte) {
     if (C2H[hex[0]] < 0 || C2H[m_oddByte] < 0)
-      BOOST_THROW_EXCEPTION(Error(getIndex(), "Wrong input byte"));
+      NDN_THROW(Error(getIndex(), "Wrong input byte"));
 
     *it = (C2H[m_oddByte] << 4) + C2H[hex[0]];
     ++it;
@@ -99,7 +99,7 @@
 
   while (hexLen >= 2) {
     if (C2H[hex[0]] < 0 || C2H[hex[1]] < 0)
-      BOOST_THROW_EXCEPTION(Error(getIndex(), "Wrong input byte"));
+      NDN_THROW(Error(getIndex(), "Wrong input byte"));
 
     *it = (C2H[hex[0]] << 4) + C2H[hex[1]];
     ++it;
diff --git a/ndn-cxx/security/transform/hmac-filter.cpp b/ndn-cxx/security/transform/hmac-filter.cpp
index 4ab4a97..205b480 100644
--- a/ndn-cxx/security/transform/hmac-filter.cpp
+++ b/ndn-cxx/security/transform/hmac-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -55,16 +55,15 @@
 
   const EVP_MD* md = detail::digestAlgorithmToEvpMd(algo);
   if (md == nullptr)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported digest algorithm " +
-                                boost::lexical_cast<std::string>(algo)));
+    NDN_THROW(Error(getIndex(), "Unsupported digest algorithm " + boost::lexical_cast<std::string>(algo)));
 
   m_impl->key = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, nullptr, key, static_cast<int>(keyLen));
   if (m_impl->key == nullptr)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to create HMAC key"));
+    NDN_THROW(Error(getIndex(), "Failed to create HMAC key"));
 
   if (EVP_DigestSignInit(m_impl->ctx, nullptr, md, nullptr, m_impl->key) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to initialize HMAC context with " +
-                                boost::lexical_cast<std::string>(algo) + " digest"));
+    NDN_THROW(Error(getIndex(), "Failed to initialize HMAC context with " +
+                    boost::lexical_cast<std::string>(algo) + " digest"));
 }
 
 HmacFilter::~HmacFilter() = default;
@@ -73,7 +72,7 @@
 HmacFilter::convert(const uint8_t* buf, size_t size)
 {
   if (EVP_DigestSignUpdate(m_impl->ctx, buf, size) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+    NDN_THROW(Error(getIndex(), "Failed to accept more input"));
 
   return size;
 }
@@ -85,7 +84,7 @@
   size_t hmacLen = 0;
 
   if (EVP_DigestSignFinal(m_impl->ctx, buffer->data(), &hmacLen) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to finalize HMAC"));
+    NDN_THROW(Error(getIndex(), "Failed to finalize HMAC"));
 
   buffer->erase(buffer->begin() + hmacLen, buffer->end());
   setOutputBuffer(std::move(buffer));
diff --git a/ndn-cxx/security/transform/private-key.cpp b/ndn-cxx/security/transform/private-key.cpp
index 98358b8..91bfbeb 100644
--- a/ndn-cxx/security/transform/private-key.cpp
+++ b/ndn-cxx/security/transform/private-key.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -35,13 +35,13 @@
 #define ENSURE_PRIVATE_KEY_LOADED(key) \
   do { \
     if ((key) == nullptr) \
-      BOOST_THROW_EXCEPTION(Error("Private key has not been loaded yet")); \
+      NDN_THROW(Error("Private key has not been loaded yet")); \
   } while (false)
 
 #define ENSURE_PRIVATE_KEY_NOT_LOADED(key) \
   do { \
     if ((key) != nullptr) \
-      BOOST_THROW_EXCEPTION(Error("Private key has already been loaded")); \
+      NDN_THROW(Error("Private key has already been loaded")); \
   } while (false)
 
 namespace ndn {
@@ -107,7 +107,7 @@
   opensslInitAlgorithms();
 
   if (d2i_AutoPrivateKey(&m_impl->key, &buf, static_cast<long>(size)) == nullptr)
-    BOOST_THROW_EXCEPTION(Error("Failed to load private key"));
+    NDN_THROW(Error("Failed to load private key"));
 }
 
 void
@@ -143,10 +143,10 @@
 
   detail::Bio membio(BIO_s_mem());
   if (!membio.write(buf, size))
-    BOOST_THROW_EXCEPTION(Error("Failed to copy buffer"));
+    NDN_THROW(Error("Failed to copy buffer"));
 
   if (d2i_PKCS8PrivateKey_bio(membio, &m_impl->key, nullptr, const_cast<char*>(pw)) == nullptr)
-    BOOST_THROW_EXCEPTION(Error("Failed to load private key"));
+    NDN_THROW(Error("Failed to load private key"));
 }
 
 static inline int
@@ -165,7 +165,7 @@
 
   detail::Bio membio(BIO_s_mem());
   if (!membio.write(buf, size))
-    BOOST_THROW_EXCEPTION(Error("Failed to copy buffer"));
+    NDN_THROW(Error("Failed to copy buffer"));
 
   if (pwCallback)
     m_impl->key = d2i_PKCS8PrivateKey_bio(membio, nullptr, &passwordCallbackWrapper, &pwCallback);
@@ -173,7 +173,7 @@
     m_impl->key = d2i_PKCS8PrivateKey_bio(membio, nullptr, nullptr, nullptr);
 
   if (m_impl->key == nullptr)
-    BOOST_THROW_EXCEPTION(Error("Failed to load private key"));
+    NDN_THROW(Error("Failed to load private key"));
 }
 
 void
@@ -268,7 +268,7 @@
   uint8_t* pkcs8 = nullptr;
   int len = i2d_PUBKEY(m_impl->key, &pkcs8);
   if (len < 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to derive public key"));
+    NDN_THROW(Error("Failed to derive public key"));
 
   auto result = make_shared<Buffer>(pkcs8, len);
   OPENSSL_free(pkcs8);
@@ -284,11 +284,11 @@
   int keyType = detail::getEvpPkeyType(m_impl->key);
   switch (keyType) {
     case EVP_PKEY_NONE:
-      BOOST_THROW_EXCEPTION(Error("Failed to determine key type"));
+      NDN_THROW(Error("Failed to determine key type"));
     case EVP_PKEY_RSA:
       return rsaDecrypt(cipherText, cipherLen);
     default:
-      BOOST_THROW_EXCEPTION(Error("Decryption is not supported for key type " + to_string(keyType)));
+      NDN_THROW(Error("Decryption is not supported for key type " + to_string(keyType)));
   }
 }
 
@@ -306,7 +306,7 @@
 
   detail::Bio membio(BIO_s_mem());
   if (!i2d_PrivateKey_bio(membio, m_impl->key))
-    BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #1 format"));
+    NDN_THROW(Error("Cannot convert key to PKCS #1 format"));
 
   auto buffer = make_shared<Buffer>(BIO_pending(membio));
   membio.read(buffer->data(), buffer->size());
@@ -324,7 +324,7 @@
   detail::Bio membio(BIO_s_mem());
   if (!i2d_PKCS8PrivateKey_bio(membio, m_impl->key, EVP_aes_256_cbc(), nullptr, 0,
                                nullptr, const_cast<char*>(pw)))
-    BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));
+    NDN_THROW(Error("Cannot convert key to PKCS #8 format"));
 
   auto buffer = make_shared<Buffer>(BIO_pending(membio));
   membio.read(buffer->data(), buffer->size());
@@ -341,7 +341,7 @@
   detail::Bio membio(BIO_s_mem());
   if (!i2d_PKCS8PrivateKey_bio(membio, m_impl->key, EVP_aes_256_cbc(), nullptr, 0,
                                &passwordCallbackWrapper, &pwCallback))
-    BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));
+    NDN_THROW(Error("Cannot convert key to PKCS #8 format"));
 
   auto buffer = make_shared<Buffer>(BIO_pending(membio));
   membio.read(buffer->data(), buffer->size());
@@ -355,19 +355,19 @@
   detail::EvpPkeyCtx ctx(m_impl->key);
 
   if (EVP_PKEY_decrypt_init(ctx) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to initialize decryption context"));
+    NDN_THROW(Error("Failed to initialize decryption context"));
 
   if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_OAEP_PADDING) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to set padding"));
+    NDN_THROW(Error("Failed to set padding"));
 
   size_t outlen = 0;
   // Determine buffer length
   if (EVP_PKEY_decrypt(ctx, nullptr, &outlen, cipherText, cipherLen) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to estimate output length"));
+    NDN_THROW(Error("Failed to estimate output length"));
 
   auto out = make_shared<Buffer>(outlen);
   if (EVP_PKEY_decrypt(ctx, out->data(), &outlen, cipherText, cipherLen) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to decrypt ciphertext"));
+    NDN_THROW(Error("Failed to decrypt ciphertext"));
 
   out->resize(outlen);
   return out;
@@ -379,14 +379,14 @@
   detail::EvpPkeyCtx kctx(EVP_PKEY_RSA);
 
   if (EVP_PKEY_keygen_init(kctx) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to initialize RSA keygen context"));
+    NDN_THROW(PrivateKey::Error("Failed to initialize RSA keygen context"));
 
   if (EVP_PKEY_CTX_set_rsa_keygen_bits(kctx, static_cast<int>(keySize)) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to set RSA key length"));
+    NDN_THROW(PrivateKey::Error("Failed to set RSA key length"));
 
   auto privateKey = make_unique<PrivateKey>();
   if (EVP_PKEY_keygen(kctx, &privateKey->m_impl->key) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to generate RSA key"));
+    NDN_THROW(PrivateKey::Error("Failed to generate RSA key"));
 
   return privateKey;
 }
@@ -397,7 +397,7 @@
   detail::EvpPkeyCtx pctx(EVP_PKEY_EC);
 
   if (EVP_PKEY_paramgen_init(pctx) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to initialize EC paramgen context"));
+    NDN_THROW(PrivateKey::Error("Failed to initialize EC paramgen context"));
 
   int ret;
   switch (keySize) {
@@ -414,22 +414,22 @@
     ret = EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_secp521r1);
     break;
   default:
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Unsupported EC key length " + to_string(keySize)));
+    NDN_THROW(std::invalid_argument("Unsupported EC key length " + to_string(keySize)));
   }
   if (ret <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to set EC curve"));
+    NDN_THROW(PrivateKey::Error("Failed to set EC curve"));
 
   Impl params;
   if (EVP_PKEY_paramgen(pctx, &params.key) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to generate EC parameters"));
+    NDN_THROW(PrivateKey::Error("Failed to generate EC parameters"));
 
   detail::EvpPkeyCtx kctx(params.key);
   if (EVP_PKEY_keygen_init(kctx) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to initialize EC keygen context"));
+    NDN_THROW(PrivateKey::Error("Failed to initialize EC keygen context"));
 
   auto privateKey = make_unique<PrivateKey>();
   if (EVP_PKEY_keygen(kctx, &privateKey->m_impl->key) <= 0)
-    BOOST_THROW_EXCEPTION(PrivateKey::Error("Failed to generate EC key"));
+    NDN_THROW(PrivateKey::Error("Failed to generate EC key"));
 
   return privateKey;
 }
@@ -447,8 +447,8 @@
       return PrivateKey::generateEcKey(ecParams.getKeySize());
     }
     default:
-      BOOST_THROW_EXCEPTION(std::invalid_argument("Unsupported asymmetric key type " +
-                                                  boost::lexical_cast<std::string>(keyParams.getKeyType())));
+      NDN_THROW(std::invalid_argument("Unsupported asymmetric key type " +
+                                      boost::lexical_cast<std::string>(keyParams.getKeyType())));
   }
 }
 
diff --git a/ndn-cxx/security/transform/public-key.cpp b/ndn-cxx/security/transform/public-key.cpp
index d6f8b20..d38b1d7 100644
--- a/ndn-cxx/security/transform/public-key.cpp
+++ b/ndn-cxx/security/transform/public-key.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -31,13 +31,13 @@
 #define ENSURE_PUBLIC_KEY_LOADED(key) \
   do { \
     if ((key) == nullptr) \
-      BOOST_THROW_EXCEPTION(Error("Public key has not been loaded yet")); \
+      NDN_THROW(Error("Public key has not been loaded yet")); \
   } while (false)
 
 #define ENSURE_PUBLIC_KEY_NOT_LOADED(key) \
   do { \
     if ((key) != nullptr) \
-      BOOST_THROW_EXCEPTION(Error("Public key has already been loaded")); \
+      NDN_THROW(Error("Public key has already been loaded")); \
   } while (false)
 
 namespace ndn {
@@ -90,7 +90,7 @@
   ENSURE_PUBLIC_KEY_NOT_LOADED(m_impl->key);
 
   if (d2i_PUBKEY(&m_impl->key, &buf, static_cast<long>(size)) == nullptr)
-    BOOST_THROW_EXCEPTION(Error("Failed to load public key"));
+    NDN_THROW(Error("Failed to load public key"));
 }
 
 void
@@ -137,11 +137,11 @@
   int keyType = detail::getEvpPkeyType(m_impl->key);
   switch (keyType) {
     case EVP_PKEY_NONE:
-      BOOST_THROW_EXCEPTION(Error("Failed to determine key type"));
+      NDN_THROW(Error("Failed to determine key type"));
     case EVP_PKEY_RSA:
       return rsaEncrypt(plainText, plainLen);
     default:
-      BOOST_THROW_EXCEPTION(Error("Encryption is not supported for key type " + to_string(keyType)));
+      NDN_THROW(Error("Encryption is not supported for key type " + to_string(keyType)));
   }
 }
 
@@ -159,7 +159,7 @@
   uint8_t* pkcs8 = nullptr;
   int len = i2d_PUBKEY(m_impl->key, &pkcs8);
   if (len < 0)
-    BOOST_THROW_EXCEPTION(Error("Cannot convert key to PKCS #8 format"));
+    NDN_THROW(Error("Cannot convert key to PKCS #8 format"));
 
   auto buffer = make_shared<Buffer>(pkcs8, len);
   OPENSSL_free(pkcs8);
@@ -173,19 +173,19 @@
   detail::EvpPkeyCtx ctx(m_impl->key);
 
   if (EVP_PKEY_encrypt_init(ctx) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to initialize encryption context"));
+    NDN_THROW(Error("Failed to initialize encryption context"));
 
   if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_OAEP_PADDING) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to set padding"));
+    NDN_THROW(Error("Failed to set padding"));
 
   size_t outlen = 0;
   // Determine buffer length
   if (EVP_PKEY_encrypt(ctx, nullptr, &outlen, plainText, plainLen) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to estimate output length"));
+    NDN_THROW(Error("Failed to estimate output length"));
 
   auto out = make_shared<Buffer>(outlen);
   if (EVP_PKEY_encrypt(ctx, out->data(), &outlen, plainText, plainLen) <= 0)
-    BOOST_THROW_EXCEPTION(Error("Failed to encrypt plaintext"));
+    NDN_THROW(Error("Failed to encrypt plaintext"));
 
   out->resize(outlen);
   return out;
diff --git a/ndn-cxx/security/transform/signer-filter.cpp b/ndn-cxx/security/transform/signer-filter.cpp
index b6ae6dd..33f380f 100644
--- a/ndn-cxx/security/transform/signer-filter.cpp
+++ b/ndn-cxx/security/transform/signer-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -41,14 +41,14 @@
 {
   const EVP_MD* md = detail::digestAlgorithmToEvpMd(algo);
   if (md == nullptr)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported digest algorithm " +
-                                boost::lexical_cast<std::string>(algo)));
+    NDN_THROW(Error(getIndex(), "Unsupported digest algorithm " +
+                    boost::lexical_cast<std::string>(algo)));
 
   if (EVP_DigestSignInit(m_impl->ctx, nullptr, md, nullptr,
                          reinterpret_cast<EVP_PKEY*>(key.getEvpPkey())) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to initialize signing context with " +
-                                boost::lexical_cast<std::string>(algo) + " digest and " +
-                                boost::lexical_cast<std::string>(key.getKeyType()) + " key"));
+    NDN_THROW(Error(getIndex(), "Failed to initialize signing context with " +
+                    boost::lexical_cast<std::string>(algo) + " digest and " +
+                    boost::lexical_cast<std::string>(key.getKeyType()) + " key"));
 }
 
 SignerFilter::~SignerFilter() = default;
@@ -57,7 +57,7 @@
 SignerFilter::convert(const uint8_t* buf, size_t size)
 {
   if (EVP_DigestSignUpdate(m_impl->ctx, buf, size) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+    NDN_THROW(Error(getIndex(), "Failed to accept more input"));
 
   return size;
 }
@@ -67,11 +67,11 @@
 {
   size_t sigLen = 0;
   if (EVP_DigestSignFinal(m_impl->ctx, nullptr, &sigLen) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to estimate buffer length"));
+    NDN_THROW(Error(getIndex(), "Failed to estimate buffer length"));
 
   auto buffer = make_unique<OBuffer>(sigLen);
   if (EVP_DigestSignFinal(m_impl->ctx, buffer->data(), &sigLen) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to finalize signature"));
+    NDN_THROW(Error(getIndex(), "Failed to finalize signature"));
 
   buffer->erase(buffer->begin() + sigLen, buffer->end());
   setOutputBuffer(std::move(buffer));
diff --git a/ndn-cxx/security/transform/stream-sink.cpp b/ndn-cxx/security/transform/stream-sink.cpp
index d8b25e7..5eba76a 100644
--- a/ndn-cxx/security/transform/stream-sink.cpp
+++ b/ndn-cxx/security/transform/stream-sink.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -38,7 +38,7 @@
   m_os.write(reinterpret_cast<const char*>(buf), size);
 
   if (m_os.bad())
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Fail to write data into output stream"));
+    NDN_THROW(Error(getIndex(), "Fail to write data into output stream"));
 
   return size;
 }
diff --git a/ndn-cxx/security/transform/stream-source.cpp b/ndn-cxx/security/transform/stream-source.cpp
index f86ba99..40fb7a4 100644
--- a/ndn-cxx/security/transform/stream-source.cpp
+++ b/ndn-cxx/security/transform/stream-source.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -56,7 +56,7 @@
       dataLen -= nBytesWritten;
     }
     else if (!m_is) {
-      BOOST_THROW_EXCEPTION(Error(getIndex(), "Input stream in bad state"));
+      NDN_THROW(Error(getIndex(), "Input stream in bad state"));
     }
     else if (m_is.good()) {
       m_is.read(reinterpret_cast<char*>(&buffer.front()), buffer.size());
diff --git a/ndn-cxx/security/transform/transform-base.cpp b/ndn-cxx/security/transform/transform-base.cpp
index 571a557..9bd661d 100644
--- a/ndn-cxx/security/transform/transform-base.cpp
+++ b/ndn-cxx/security/transform/transform-base.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -41,7 +41,7 @@
 Downstream::write(const uint8_t* buf, size_t size)
 {
   if (m_isEnd)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Module is closed, no more input"));
+    NDN_THROW(Error(getIndex(), "Module is closed, no more input"));
 
   size_t nBytesWritten = doWrite(buf, size);
   BOOST_ASSERT(nBytesWritten <= size);
diff --git a/ndn-cxx/security/transform/verifier-filter.cpp b/ndn-cxx/security/transform/verifier-filter.cpp
index 51eb4b4..98cb3c1 100644
--- a/ndn-cxx/security/transform/verifier-filter.cpp
+++ b/ndn-cxx/security/transform/verifier-filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -51,14 +51,14 @@
 {
   const EVP_MD* md = detail::digestAlgorithmToEvpMd(algo);
   if (md == nullptr)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Unsupported digest algorithm " +
-                                boost::lexical_cast<std::string>(algo)));
+    NDN_THROW(Error(getIndex(), "Unsupported digest algorithm " +
+                    boost::lexical_cast<std::string>(algo)));
 
   if (EVP_DigestVerifyInit(m_impl->ctx, nullptr, md, nullptr,
                            reinterpret_cast<EVP_PKEY*>(key.getEvpPkey())) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to initialize verification context with " +
-                                boost::lexical_cast<std::string>(algo) + " digest and " +
-                                boost::lexical_cast<std::string>(key.getKeyType()) + " key"));
+    NDN_THROW(Error(getIndex(), "Failed to initialize verification context with " +
+                    boost::lexical_cast<std::string>(algo) + " digest and " +
+                    boost::lexical_cast<std::string>(key.getKeyType()) + " key"));
 }
 
 VerifierFilter::~VerifierFilter() = default;
@@ -67,7 +67,7 @@
 VerifierFilter::convert(const uint8_t* buf, size_t size)
 {
   if (EVP_DigestVerifyUpdate(m_impl->ctx, buf, size) != 1)
-    BOOST_THROW_EXCEPTION(Error(getIndex(), "Failed to accept more input"));
+    NDN_THROW(Error(getIndex(), "Failed to accept more input"));
 
   return size;
 }
diff --git a/ndn-cxx/security/v2/additional-description.cpp b/ndn-cxx/security/v2/additional-description.cpp
index 143ce2c..d885cca 100644
--- a/ndn-cxx/security/v2/additional-description.cpp
+++ b/ndn-cxx/security/v2/additional-description.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -47,7 +47,7 @@
 {
   auto it = m_info.find(key);
   if (it == m_info.end())
-    BOOST_THROW_EXCEPTION(Error("Entry does not exist for key (" + key + ")"));
+    NDN_THROW(Error("Entry does not exist for key (" + key + ")"));
 
   return it->second;
 }
@@ -133,29 +133,29 @@
 AdditionalDescription::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"));
   }
 
   m_wire = wire;
   m_wire.parse();
 
   if (m_wire.type() != tlv::AdditionalDescription)
-    BOOST_THROW_EXCEPTION(Error("Unexpected TLV type when decoding AdditionalDescription"));
+    NDN_THROW(Error("AdditionalDescription", m_wire.type()));
 
-  Block::element_const_iterator it = m_wire.elements_begin();
+  auto it = m_wire.elements_begin();
   while (it != m_wire.elements_end()) {
     const Block& entry = *it;
     entry.parse();
 
     if (entry.type() != tlv::DescriptionEntry)
-      BOOST_THROW_EXCEPTION(Error("Unexpected TLV type when decoding DescriptionEntry"));
+      NDN_THROW(Error("DescriptionEntry", entry.type()));
 
     if (entry.elements_size() != 2)
-      BOOST_THROW_EXCEPTION(Error("DescriptionEntry does not have two sub-TLVs"));
+      NDN_THROW(Error("DescriptionEntry does not have two sub-TLVs"));
 
     if (entry.elements()[KEY_OFFSET].type() != tlv::DescriptionKey ||
         entry.elements()[VALUE_OFFSET].type() != tlv::DescriptionValue)
-      BOOST_THROW_EXCEPTION(Error("Invalid DescriptionKey or DescriptionValue field"));
+      NDN_THROW(Error("Invalid DescriptionKey or DescriptionValue field"));
 
     m_info[readString(entry.elements()[KEY_OFFSET])] = readString(entry.elements()[VALUE_OFFSET]);
     it++;
diff --git a/ndn-cxx/security/v2/certificate.cpp b/ndn-cxx/security/v2/certificate.cpp
index 03e40cf..9883825 100644
--- a/ndn-cxx/security/v2/certificate.cpp
+++ b/ndn-cxx/security/v2/certificate.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -47,23 +47,23 @@
 
 Certificate::Certificate()
 {
-  setContentType(tlv::ContentTypeValue::ContentType_Key);
+  setContentType(tlv::ContentType_Key);
 }
 
 Certificate::Certificate(Data&& data)
   : Data(data)
 {
   if (!isValidName(getName())) {
-    BOOST_THROW_EXCEPTION(Data::Error("Name does not follow the naming convention for certificate"));
+    NDN_THROW(Data::Error("Name does not follow the naming convention for certificate"));
   }
-  if (getContentType() != tlv::ContentTypeValue::ContentType_Key) {
-    BOOST_THROW_EXCEPTION(Data::Error("ContentType is not KEY"));
+  if (getContentType() != tlv::ContentType_Key) {
+    NDN_THROW(Data::Error("Expecting ContentType Key, got " + to_string(getContentType())));
   }
   if (getFreshnessPeriod() < time::seconds::zero()) {
-    BOOST_THROW_EXCEPTION(Data::Error("FreshnessPeriod is not set"));
+    NDN_THROW(Data::Error("FreshnessPeriod is not set"));
   }
   if (getContent().value_size() == 0) {
-    BOOST_THROW_EXCEPTION(Data::Error("Content is empty"));
+    NDN_THROW(Data::Error("Content is empty"));
   }
 }
 
@@ -105,7 +105,7 @@
 Certificate::getPublicKey() const
 {
   if (getContent().value_size() == 0)
-    BOOST_THROW_EXCEPTION(Data::Error("Content is empty"));
+    NDN_THROW(Data::Error("Content is empty"));
   return Buffer(getContent().value(), getContent().value_size());
 }
 
@@ -185,8 +185,8 @@
 extractIdentityFromCertName(const Name& certName)
 {
   if (!Certificate::isValidName(certName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
-                                                "does not follow the naming conventions"));
+    NDN_THROW(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
+                                    "does not respect the naming conventions"));
   }
 
   return certName.getPrefix(Certificate::KEY_COMPONENT_OFFSET); // trim everything after and including "KEY"
@@ -196,8 +196,8 @@
 extractKeyNameFromCertName(const Name& certName)
 {
   if (!Certificate::isValidName(certName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
-                                                "does not follow the naming conventions"));
+    NDN_THROW(std::invalid_argument("Certificate name `" + certName.toUri() + "` "
+                                    "does not respect the naming conventions"));
   }
 
   return certName.getPrefix(Certificate::KEY_ID_OFFSET + 1); // trim everything after key id
diff --git a/ndn-cxx/security/v2/key-chain.cpp b/ndn-cxx/security/v2/key-chain.cpp
index 6ea29ca..8043635 100644
--- a/ndn-cxx/security/v2/key-chain.cpp
+++ b/ndn-cxx/security/v2/key-chain.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -202,8 +202,8 @@
       if (allowReset)
         m_pib->reset();
       else
-        BOOST_THROW_EXCEPTION(LocatorMismatchError("TPM locator supplied does not match TPM locator in PIB: " +
-                                                   oldTpmLocator + " != " + canonicalTpmLocator));
+        NDN_THROW(LocatorMismatchError("TPM locator supplied does not match TPM locator in PIB: " +
+                                       oldTpmLocator + " != " + canonicalTpmLocator));
     }
   }
 
@@ -290,8 +290,8 @@
 
   Name keyName = key.getName();
   if (identity.getName() != key.getIdentity()) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Identity `" + identity.getName().toUri() + "` "
-                                                "does not match key `" + keyName.toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Identity `" + identity.getName().toUri() + "` "
+                                    "does not match key `" + keyName.toUri() + "`"));
   }
 
   identity.removeKey(keyName);
@@ -305,8 +305,8 @@
   BOOST_ASSERT(static_cast<bool>(key));
 
   if (identity.getName() != key.getIdentity())
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Identity `" + identity.getName().toUri() + "` "
-                                                "does not match key `" + key.getName().toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Identity `" + identity.getName().toUri() + "` "
+                                    "does not match key `" + key.getName().toUri() + "`"));
 
   identity.setDefaultKey(key.getName());
 }
@@ -319,8 +319,8 @@
   if (key.getName() != certificate.getKeyName() ||
       !std::equal(certificate.getContent().value_begin(), certificate.getContent().value_end(),
                   key.getPublicKey().begin()))
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Key `" + key.getName().toUri() + "` "
-                                                "does not match certificate `" + certificate.getName().toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Key `" + key.getName().toUri() + "` "
+                                    "does not match certificate `" + certificate.getName().toUri() + "`"));
 
   key.addCertificate(certificate);
 }
@@ -331,7 +331,7 @@
   BOOST_ASSERT(static_cast<bool>(key));
 
   if (!Certificate::isValidName(certificateName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Wrong certificate name `" + certificateName.toUri() + "`"));
+    NDN_THROW(std::invalid_argument("Wrong certificate name `" + certificateName.toUri() + "`"));
   }
 
   key.removeCertificate(certificateName);
@@ -356,8 +356,8 @@
   try {
     encryptedKey = m_tpm->exportPrivateKey(keyName, pw, pwLen);
   }
-  catch (const tpm::BackEnd::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Failed to export private key `" + keyName.toUri() + "`: " + e.what()));
+  catch (const tpm::BackEnd::Error&) {
+    NDN_THROW_NESTED(Error("Failed to export private key `" + keyName.toUri() + "`"));
   }
 
   return make_shared<SafeBag>(certificate, *encryptedKey);
@@ -373,13 +373,13 @@
   const Buffer publicKeyBits = cert.getPublicKey();
 
   if (m_tpm->hasKey(keyName)) {
-    BOOST_THROW_EXCEPTION(Error("Private key `" + keyName.toUri() + "` already exists"));
+    NDN_THROW(Error("Private key `" + keyName.toUri() + "` already exists"));
   }
 
   try {
     Identity existingId = m_pib->getIdentity(identity);
     existingId.getKey(keyName);
-    BOOST_THROW_EXCEPTION(Error("Public key `" + keyName.toUri() + "` already exists"));
+    NDN_THROW(Error("Public key `" + keyName.toUri() + "` already exists"));
   }
   catch (const Pib::Error&) {
     // Either identity or key doesn't exist. OK to import.
@@ -390,8 +390,8 @@
                             safeBag.getEncryptedKeyBag().data(), safeBag.getEncryptedKeyBag().size(),
                             pw, pwLen);
   }
-  catch (const tpm::BackEnd::Error& e) {
-    BOOST_THROW_EXCEPTION(Error("Failed to import private key `" + keyName.toUri() + "`: " + e.what()));
+  catch (const tpm::BackEnd::Error&) {
+    NDN_THROW_NESTED(Error("Failed to import private key `" + keyName.toUri() + "`"));
   }
 
   // check the consistency of private key and certificate
@@ -402,7 +402,7 @@
   }
   catch (const std::runtime_error&) {
     m_tpm->deleteKey(keyName);
-    BOOST_THROW_EXCEPTION(Error("Invalid private key `" + keyName.toUri() + "`"));
+    NDN_THROW(Error("Invalid private key `" + keyName.toUri() + "`"));
   }
   bool isVerified = false;
   {
@@ -415,8 +415,8 @@
   }
   if (!isVerified) {
     m_tpm->deleteKey(keyName);
-    BOOST_THROW_EXCEPTION(Error("Certificate `" + cert.getName().toUri() + "` "
-                                "and private key `" + keyName.toUri() + "` do not match"));
+    NDN_THROW(Error("Certificate `" + cert.getName().toUri() + "` "
+                    "and private key `" + keyName.toUri() + "` do not match"));
   }
 
   Identity id = m_pib->addIdentity(identity);
@@ -497,7 +497,7 @@
 
   auto pibFactory = getPibFactories().find(pibScheme);
   if (pibFactory == getPibFactories().end()) {
-    BOOST_THROW_EXCEPTION(KeyChain::Error("PIB scheme `" + pibScheme + "` is not supported"));
+    NDN_THROW(KeyChain::Error("PIB scheme `" + pibScheme + "` is not supported"));
   }
 
   return std::make_tuple(pibScheme, pibLocation);
@@ -524,7 +524,7 @@
   }
   auto tpmFactory = getTpmFactories().find(tpmScheme);
   if (tpmFactory == getTpmFactories().end()) {
-    BOOST_THROW_EXCEPTION(KeyChain::Error("TPM scheme `" + tpmScheme + "` is not supported"));
+    NDN_THROW(KeyChain::Error("TPM scheme `" + tpmScheme + "` is not supported"));
   }
 
   return std::make_tuple(tpmScheme, tpmLocation);
@@ -578,11 +578,8 @@
 KeyChain::prepareSignatureInfo(const SigningInfo& params)
 {
   SignatureInfo sigInfo = params.getSignatureInfo();
-
-  Name identityName;
   name::Component keyId;
   Name certificateName;
-
   pib::Identity identity;
   pib::Key key;
 
@@ -604,8 +601,8 @@
           identity = m_pib->getIdentity(params.getSignerName());
         }
         catch (const Pib::Error&) {
-          BOOST_THROW_EXCEPTION(InvalidSigningInfoError("Signing identity `" +
-                                                        params.getSignerName().toUri() + "` does not exist"));
+          NDN_THROW_NESTED(InvalidSigningInfoError("Signing identity `" +
+                                                   params.getSignerName().toUri() + "` does not exist"));
         }
       }
       break;
@@ -614,15 +611,14 @@
       key = params.getPibKey();
       if (!key) {
         Name identityName = extractIdentityFromKeyName(params.getSignerName());
-
         try {
           identity = m_pib->getIdentity(identityName);
           key = identity.getKey(params.getSignerName());
           identity = Identity(); // we will use the PIB key instance, so reset identity;
         }
         catch (const Pib::Error&) {
-          BOOST_THROW_EXCEPTION(InvalidSigningInfoError("Signing key `" +
-                                                        params.getSignerName().toUri() + "` does not exist"));
+          NDN_THROW_NESTED(InvalidSigningInfoError("Signing key `" +
+                                                   params.getSignerName().toUri() + "` does not exist"));
         }
       }
       break;
@@ -630,16 +626,14 @@
     case SigningInfo::SIGNER_TYPE_CERT: {
       Name identityName = extractIdentityFromCertName(params.getSignerName());
       Name keyName = extractKeyNameFromCertName(params.getSignerName());
-
       try {
         identity = m_pib->getIdentity(identityName);
         key = identity.getKey(keyName);
       }
       catch (const Pib::Error&) {
-        BOOST_THROW_EXCEPTION(InvalidSigningInfoError("Signing certificate `" +
-                                                      params.getSignerName().toUri() + "` does not exist"));
+        NDN_THROW_NESTED(InvalidSigningInfoError("Signing certificate `" +
+                                                 params.getSignerName().toUri() + "` does not exist"));
       }
-
       break;
     }
     case SigningInfo::SIGNER_TYPE_SHA256: {
@@ -647,13 +641,13 @@
       return std::make_tuple(SigningInfo::getDigestSha256Identity(), sigInfo);
     }
     default: {
-      BOOST_THROW_EXCEPTION(InvalidSigningInfoError("Unrecognized signer type " +
-                                                    boost::lexical_cast<std::string>(params.getSignerType())));
+      NDN_THROW(InvalidSigningInfoError("Unrecognized signer type " +
+                                        boost::lexical_cast<std::string>(params.getSignerType())));
     }
   }
 
   if (!identity && !key) {
-    BOOST_THROW_EXCEPTION(InvalidSigningInfoError("Cannot determine signing parameters"));
+    NDN_THROW(InvalidSigningInfoError("Cannot determine signing parameters"));
   }
 
   if (identity && !key) {
@@ -661,8 +655,8 @@
       key = identity.getDefaultKey();
     }
     catch (const Pib::Error&) {
-      BOOST_THROW_EXCEPTION(InvalidSigningInfoError("Signing identity `" + identity.getName().toUri() +
-                                                    "` does not have a default certificate"));
+      NDN_THROW_NESTED(InvalidSigningInfoError("Signing identity `" + identity.getName().toUri() +
+                                               "` does not have a default certificate"));
     }
   }
 
@@ -686,7 +680,7 @@
 }
 
 tlv::SignatureTypeValue
-KeyChain::getSignatureType(KeyType keyType, DigestAlgorithm digestAlgorithm)
+KeyChain::getSignatureType(KeyType keyType, DigestAlgorithm)
 {
   switch (keyType) {
   case KeyType::RSA:
@@ -694,7 +688,7 @@
   case KeyType::EC:
     return tlv::SignatureSha256WithEcdsa;
   default:
-    BOOST_THROW_EXCEPTION(Error("Unsupported key types"));
+    NDN_THROW(Error("Unsupported key type " + boost::lexical_cast<std::string>(keyType)));
   }
 }
 
diff --git a/ndn-cxx/security/v2/trust-anchor-container.cpp b/ndn-cxx/security/v2/trust-anchor-container.cpp
index c6c5e63..f77f233 100644
--- a/ndn-cxx/security/v2/trust-anchor-container.cpp
+++ b/ndn-cxx/security/v2/trust-anchor-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -54,7 +54,7 @@
   }
   auto* staticGroup = dynamic_cast<StaticTrustAnchorGroup*>(&**group);
   if (staticGroup == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Cannot add static anchor to a non-static anchor group " + groupId));
+    NDN_THROW(Error("Cannot add static anchor to a non-static anchor group " + groupId));
   }
   staticGroup->add(std::move(cert));
 }
@@ -64,7 +64,7 @@
                              time::nanoseconds refreshPeriod, bool isDir)
 {
   if (m_groups.count(groupId) != 0) {
-    BOOST_THROW_EXCEPTION(Error("Cannot create dynamic group, because group " + groupId + " already exists"));
+    NDN_THROW(Error("Cannot create dynamic group, because group " + groupId + " already exists"));
   }
 
   m_groups.insert(make_shared<DynamicTrustAnchorGroup>(m_anchors, groupId, path, refreshPeriod, isDir));
@@ -109,7 +109,7 @@
 {
   auto group = m_groups.find(groupId);
   if (group == m_groups.end()) {
-    BOOST_THROW_EXCEPTION(Error("Trust anchor group " + groupId + " does not exist"));
+    NDN_THROW(Error("Trust anchor group " + groupId + " does not exist"));
   }
   return **group;
 }
diff --git a/ndn-cxx/security/v2/trust-anchor-group.cpp b/ndn-cxx/security/v2/trust-anchor-group.cpp
index 54a4bb8..1c27a41 100644
--- a/ndn-cxx/security/v2/trust-anchor-group.cpp
+++ b/ndn-cxx/security/v2/trust-anchor-group.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -92,7 +92,7 @@
   , m_refreshPeriod(refreshPeriod)
 {
   if (refreshPeriod <= time::nanoseconds::zero()) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Refresh period for the dynamic group must be positive"));
+    NDN_THROW(std::runtime_error("Refresh period for the dynamic group must be positive"));
   }
 
   NDN_LOG_TRACE("Create dynamic trust anchor group " << id << " for file/dir " << path
diff --git a/ndn-cxx/security/v2/validation-error.hpp b/ndn-cxx/security/v2/validation-error.hpp
index 9a3a7d8..826cd18 100644
--- a/ndn-cxx/security/v2/validation-error.hpp
+++ b/ndn-cxx/security/v2/validation-error.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -57,7 +57,7 @@
   /**
    * @brief Validation error, implicitly convertible from an error code and info
    */
-  ValidationError(uint32_t code,  const std::string& info = "")
+  ValidationError(uint32_t code, const std::string& info = "")
     : m_code(code)
     , m_info(info)
   {
diff --git a/ndn-cxx/security/v2/validation-policy-command-interest.cpp b/ndn-cxx/security/v2/validation-policy-command-interest.cpp
index 7a0d0a4..52f276d 100644
--- a/ndn-cxx/security/v2/validation-policy-command-interest.cpp
+++ b/ndn-cxx/security/v2/validation-policy-command-interest.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -32,7 +32,7 @@
   , m_queue(m_container.get<1>())
 {
   if (inner == nullptr) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("inner policy is missing"));
+    NDN_THROW(std::invalid_argument("inner policy is missing"));
   }
   setInnerPolicy(std::move(inner));
 
diff --git a/ndn-cxx/security/v2/validation-policy-config.cpp b/ndn-cxx/security/v2/validation-policy-config.cpp
index d3d0476..29d6f8c 100644
--- a/ndn-cxx/security/v2/validation-policy-config.cpp
+++ b/ndn-cxx/security/v2/validation-policy-config.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -46,7 +46,7 @@
 {
   std::ifstream inputFile(filename);
   if (!inputFile) {
-    BOOST_THROW_EXCEPTION(Error("Failed to read configuration file: " + filename));
+    NDN_THROW(Error("Failed to read configuration file: " + filename));
   }
   load(inputFile, filename);
 }
@@ -66,8 +66,8 @@
     boost::property_tree::read_info(input, tree);
   }
   catch (const boost::property_tree::info_parser_error& e) {
-    BOOST_THROW_EXCEPTION(Error("Failed to parse configuration file " + filename +
-                                " line " + to_string(e.line()) + ": " + e.message()));
+    NDN_THROW(Error("Failed to parse configuration file " + filename +
+                    " line " + to_string(e.line()) + ": " + e.message()));
   }
   load(tree, filename);
 }
@@ -76,7 +76,7 @@
 ValidationPolicyConfig::load(const ConfigSection& configSection, const std::string& filename)
 {
   if (m_validator == nullptr) {
-    BOOST_THROW_EXCEPTION(Error("Validator instance not assigned on the policy"));
+    NDN_THROW(Error("Validator instance not assigned on the policy"));
   }
   if (m_isConfigured) {
     m_shouldBypass = false;
@@ -90,7 +90,7 @@
   BOOST_ASSERT(!filename.empty());
 
   if (configSection.begin() == configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Error processing configuration file " + filename + ": no data"));
+    NDN_THROW(Error("Error processing configuration file " + filename + ": no data"));
   }
 
   for (const auto& subSection : configSection) {
@@ -110,8 +110,8 @@
       processConfigTrustAnchor(section, filename);
     }
     else {
-      BOOST_THROW_EXCEPTION(Error("Error processing configuration file " + filename +
-                                  ": unrecognized section " + sectionName));
+      NDN_THROW(Error("Error processing configuration file " + filename +
+                      ": unrecognized section " + sectionName));
     }
   }
 }
@@ -126,7 +126,7 @@
 
   // Get trust-anchor.type
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <trust-anchor.type>"));
+    NDN_THROW(Error("Expecting <trust-anchor.type>"));
   }
 
   std::string type = propertyIt->second.data();
@@ -135,7 +135,7 @@
   if (boost::iequals(type, "file")) {
     // Get trust-anchor.file
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "file-name")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <trust-anchor.file-name>"));
+      NDN_THROW(Error("Expecting <trust-anchor.file-name>"));
     }
 
     std::string file = propertyIt->second.data();
@@ -143,7 +143,7 @@
 
     time::nanoseconds refresh = getRefreshPeriod(propertyIt, configSection.end());
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <trust-anchor>"));
+      NDN_THROW(Error("Expecting end of <trust-anchor>"));
 
     m_validator->loadAnchor(filename, absolute(file, path(filename).parent_path()).string(),
                             refresh, false);
@@ -151,32 +151,32 @@
   else if (boost::iequals(type, "base64")) {
     // Get trust-anchor.base64-string
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "base64-string"))
-      BOOST_THROW_EXCEPTION(Error("Expecting <trust-anchor.base64-string>"));
+      NDN_THROW(Error("Expecting <trust-anchor.base64-string>"));
 
     std::stringstream ss(propertyIt->second.data());
     propertyIt++;
 
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <trust-anchor>"));
+      NDN_THROW(Error("Expecting end of <trust-anchor>"));
 
     auto idCert = io::load<Certificate>(ss);
     if (idCert != nullptr) {
       m_validator->loadAnchor("", std::move(*idCert));
     }
     else {
-      BOOST_THROW_EXCEPTION(Error("Cannot decode certificate from base64-string"));
+      NDN_THROW(Error("Cannot decode certificate from base64-string"));
     }
   }
   else if (boost::iequals(type, "dir")) {
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "dir"))
-      BOOST_THROW_EXCEPTION(Error("Expecting <trust-anchor.dir>"));
+      NDN_THROW(Error("Expecting <trust-anchor.dir>"));
 
     std::string dirString(propertyIt->second.data());
     propertyIt++;
 
     time::nanoseconds refresh = getRefreshPeriod(propertyIt, configSection.end());
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <trust-anchor>"));
+      NDN_THROW(Error("Expecting end of <trust-anchor>"));
 
     path dirPath = absolute(dirString, path(filename).parent_path());
     m_validator->loadAnchor(dirString, dirPath.string(), refresh, true);
@@ -185,7 +185,7 @@
     m_shouldBypass = true;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <trust-anchor.type>: " + type));
+    NDN_THROW(Error("Unrecognized <trust-anchor.type>: " + type));
   }
 }
 
@@ -199,7 +199,7 @@
   }
 
   if (!boost::iequals(it->first, "refresh")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <trust-anchor.refresh>"));
+    NDN_THROW(Error("Expecting <trust-anchor.refresh>"));
   }
 
   std::string inputString = it->second.data();
@@ -215,7 +215,7 @@
     // pass
   }
   if (refreshPeriod < 0) {
-    BOOST_THROW_EXCEPTION(Error("Bad refresh value: " + refreshString));
+    NDN_THROW(Error("Bad refresh value: " + refreshString));
   }
 
   if (refreshPeriod == 0) {
@@ -230,7 +230,7 @@
     case 's':
       return time::seconds(refreshPeriod);
     default:
-      BOOST_THROW_EXCEPTION(Error("Bad refresh time unit: "s + unit));
+      NDN_THROW(Error("Bad refresh time unit: "s + unit));
   }
 }
 
diff --git a/ndn-cxx/security/v2/validation-policy.cpp b/ndn-cxx/security/v2/validation-policy.cpp
index 8a235af..f182108 100644
--- a/ndn-cxx/security/v2/validation-policy.cpp
+++ b/ndn-cxx/security/v2/validation-policy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -30,7 +30,7 @@
 ValidationPolicy::setInnerPolicy(unique_ptr<ValidationPolicy> innerPolicy)
 {
   if (innerPolicy == nullptr) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Inner policy argument cannot be nullptr"));
+    NDN_THROW(std::invalid_argument("Inner policy argument cannot be nullptr"));
   }
 
   if (m_validator != nullptr) {
diff --git a/ndn-cxx/security/v2/validator-config/checker.cpp b/ndn-cxx/security/v2/validator-config/checker.cpp
index f39b8ef..db07441 100644
--- a/ndn-cxx/security/v2/validator-config/checker.cpp
+++ b/ndn-cxx/security/v2/validator-config/checker.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -128,7 +128,7 @@
 
   // Get checker.type
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <checker.type>"));
+    NDN_THROW(Error("Expecting <checker.type>"));
   }
 
   std::string type = propertyIt->second.data();
@@ -139,7 +139,7 @@
     return createHierarchicalChecker(configSection, configFilename);
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <checker.type>: " + type));
+    NDN_THROW(Error("Unrecognized <checker.type>: " + type));
   }
 }
 
@@ -159,14 +159,14 @@
 
   // Get checker.key-locator
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "key-locator")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator>"));
+    NDN_THROW(Error("Expecting <checker.key-locator>"));
   }
 
   auto checker = createKeyLocatorChecker(propertyIt->second, configFilename);
   propertyIt++;
 
   if (propertyIt != configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expecting end of <checker>"));
+    NDN_THROW(Error("Expecting end of <checker>"));
   }
   return checker;
 }
@@ -186,7 +186,7 @@
   }
 
   if (propertyIt != configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expecting end of <checker>"));
+    NDN_THROW(Error("Expecting end of <checker>"));
   }
   return make_unique<HyperRelationChecker>("^(<>*)$",        "\\1",
                                            "^(<>*)<KEY><>$", "\\1",
@@ -201,13 +201,13 @@
 
   // Get checker.key-locator.type
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type"))
-    BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.type>"));
+    NDN_THROW(Error("Expecting <checker.key-locator.type>"));
 
   std::string type = propertyIt->second.data();
   if (boost::iequals(type, "name"))
     return createKeyLocatorNameChecker(configSection, configFilename);
   else
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <checker.key-locator.type>: " + type));
+    NDN_THROW(Error("Unrecognized <checker.key-locator.type>: " + type));
 }
 
 unique_ptr<Checker>
@@ -218,7 +218,7 @@
   propertyIt++;
 
   if (propertyIt == configSection.end())
-    BOOST_THROW_EXCEPTION(Error("Unexpected end of <checker.key-locator>"));
+    NDN_THROW(Error("Unexpected end of <checker.key-locator>"));
 
   if (boost::iequals(propertyIt->first, "name")) {
     Name name;
@@ -226,12 +226,12 @@
       name = Name(propertyIt->second.data());
     }
     catch (const Name::Error&) {
-      BOOST_THROW_EXCEPTION(Error("Invalid <checker.key-locator.name>: " + propertyIt->second.data()));
+      NDN_THROW_NESTED(Error("Invalid <checker.key-locator.name>: " + propertyIt->second.data()));
     }
     propertyIt++;
 
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "relation")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.relation>"));
+      NDN_THROW(Error("Expecting <checker.key-locator.relation>"));
     }
 
     std::string relationString = propertyIt->second.data();
@@ -240,7 +240,7 @@
     NameRelation relation = getNameRelationFromString(relationString);
 
     if (propertyIt != configSection.end()) {
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <checker.key-locator>"));
+      NDN_THROW(Error("Expecting end of <checker.key-locator>"));
     }
     return make_unique<NameRelationChecker>(name, relation);
   }
@@ -249,23 +249,23 @@
     propertyIt++;
 
     if (propertyIt != configSection.end()) {
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <checker.key-locator>"));
+      NDN_THROW(Error("Expecting end of <checker.key-locator>"));
     }
 
     try {
       return make_unique<RegexChecker>(Regex(regexString));
     }
     catch (const Regex::Error&) {
-      BOOST_THROW_EXCEPTION(Error("Invalid <checker.key-locator.regex>: " + regexString));
+      NDN_THROW_NESTED(Error("Invalid <checker.key-locator.regex>: " + regexString));
     }
   }
   else if (boost::iequals(propertyIt->first, "hyper-relation")) {
     const ConfigSection& hSection = propertyIt->second;
-    ConfigSection::const_iterator hPropertyIt = hSection.begin();
+    auto hPropertyIt = hSection.begin();
 
     // Get k-regex
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "k-regex")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.k-regex>"));
+      NDN_THROW(Error("Expecting <checker.key-locator.hyper-relation.k-regex>"));
     }
 
     std::string kRegex = hPropertyIt->second.data();
@@ -273,7 +273,7 @@
 
     // Get k-expand
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "k-expand")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.k-expand>"));
+      NDN_THROW(Error("Expecting <checker.key-locator.hyper-relation.k-expand>"));
     }
 
     std::string kExpand = hPropertyIt->second.data();
@@ -281,7 +281,7 @@
 
     // Get h-relation
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "h-relation")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.h-relation>"));
+      NDN_THROW(Error("Expecting <checker.key-locator.hyper-relation.h-relation>"));
     }
 
     std::string hRelation = hPropertyIt->second.data();
@@ -289,7 +289,7 @@
 
     // Get p-regex
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "p-regex")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.p-regex>"));
+      NDN_THROW(Error("Expecting <checker.key-locator.hyper-relation.p-regex>"));
     }
 
     std::string pRegex = hPropertyIt->second.data();
@@ -297,14 +297,14 @@
 
     // Get p-expand
     if (hPropertyIt == hSection.end() || !boost::iequals(hPropertyIt->first, "p-expand")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <checker.key-locator.hyper-relation.p-expand>"));
+      NDN_THROW(Error("Expecting <checker.key-locator.hyper-relation.p-expand>"));
     }
 
     std::string pExpand = hPropertyIt->second.data();
     hPropertyIt++;
 
     if (hPropertyIt != hSection.end()) {
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <checker.key-locator.hyper-relation>"));
+      NDN_THROW(Error("Expecting end of <checker.key-locator.hyper-relation>"));
     }
 
     NameRelation relation = getNameRelationFromString(hRelation);
@@ -312,11 +312,11 @@
       return make_unique<HyperRelationChecker>(pRegex, pExpand, kRegex, kExpand, relation);
     }
     catch (const Regex::Error&) {
-      BOOST_THROW_EXCEPTION(Error("Invalid regex for <key-locator.hyper-relation>"));
+      NDN_THROW_NESTED(Error("Invalid regex for <key-locator.hyper-relation>"));
     }
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <checker.key-locator>: " + propertyIt->first));
+    NDN_THROW(Error("Unrecognized <checker.key-locator>: " + propertyIt->first));
   }
 }
 
diff --git a/ndn-cxx/security/v2/validator-config/filter.cpp b/ndn-cxx/security/v2/validator-config/filter.cpp
index f201498..8fa8b2e 100644
--- a/ndn-cxx/security/v2/validator-config/filter.cpp
+++ b/ndn-cxx/security/v2/validator-config/filter.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -78,14 +78,14 @@
   auto propertyIt = configSection.begin();
 
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "type")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <filter.type>"));
+    NDN_THROW(Error("Expecting <filter.type>"));
   }
 
   std::string type = propertyIt->second.data();
   if (boost::iequals(type, "name"))
     return createNameFilter(configSection, configFilename);
   else
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <filter.type>: " + type));
+    NDN_THROW(Error("Unrecognized <filter.type>: " + type));
 }
 
 unique_ptr<Filter>
@@ -95,7 +95,7 @@
   propertyIt++;
 
   if (propertyIt == configSection.end())
-    BOOST_THROW_EXCEPTION(Error("Unexpected end of <filter>"));
+    NDN_THROW(Error("Unexpected end of <filter>"));
 
   if (boost::iequals(propertyIt->first, "name")) {
     // Get filter.name
@@ -104,21 +104,21 @@
       name = Name(propertyIt->second.data());
     }
     catch (const Name::Error&) {
-      BOOST_THROW_EXCEPTION(Error("Invalid <filter.name>: " + propertyIt->second.data()));
+      NDN_THROW_NESTED(Error("Invalid <filter.name>: " + propertyIt->second.data()));
     }
 
     propertyIt++;
 
     // Get filter.relation
     if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "relation")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <filter.relation>"));
+      NDN_THROW(Error("Expecting <filter.relation>"));
     }
 
     NameRelation relation = getNameRelationFromString(propertyIt->second.data());
     propertyIt++;
 
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <filter>"));
+      NDN_THROW(Error("Expecting end of <filter>"));
 
     return make_unique<RelationNameFilter>(name, relation);
   }
@@ -127,17 +127,17 @@
     propertyIt++;
 
     if (propertyIt != configSection.end())
-      BOOST_THROW_EXCEPTION(Error("Expecting end of <filter>"));
+      NDN_THROW(Error("Expecting end of <filter>"));
 
     try {
       return make_unique<RegexNameFilter>(Regex(regexString));
     }
     catch (const Regex::Error&) {
-      BOOST_THROW_EXCEPTION(Error("Invalid <filter.regex>: " + regexString));
+      NDN_THROW_NESTED(Error("Invalid <filter.regex>: " + regexString));
     }
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <filter> property: " + propertyIt->first));
+    NDN_THROW(Error("Unrecognized <filter> property: " + propertyIt->first));
   }
 }
 
diff --git a/ndn-cxx/security/v2/validator-config/name-relation.cpp b/ndn-cxx/security/v2/validator-config/name-relation.cpp
index bd85ed2..ec9991d 100644
--- a/ndn-cxx/security/v2/validator-config/name-relation.cpp
+++ b/ndn-cxx/security/v2/validator-config/name-relation.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -69,7 +69,7 @@
     return NameRelation::IS_STRICT_PREFIX_OF;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unsupported relation: " + relationString));
+    NDN_THROW(Error("Unsupported relation: " + relationString));
   }
 }
 
diff --git a/ndn-cxx/security/v2/validator-config/rule.cpp b/ndn-cxx/security/v2/validator-config/rule.cpp
index e4e56cf..f0a5249 100644
--- a/ndn-cxx/security/v2/validator-config/rule.cpp
+++ b/ndn-cxx/security/v2/validator-config/rule.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -54,8 +54,8 @@
 {
   NDN_LOG_TRACE("Trying to match " << pktName);
   if (pktType != m_pktType) {
-    BOOST_THROW_EXCEPTION(Error("Invalid packet type supplied (" +
-                                to_string(pktType) + " != " + to_string(m_pktType) + ")"));
+    NDN_THROW(Error("Invalid packet type supplied (" + to_string(pktType) +
+                    " != " + to_string(m_pktType) + ")"));
   }
 
   if (m_filters.empty()) {
@@ -79,8 +79,8 @@
   NDN_LOG_TRACE("Trying to check " << pktName << " with keyLocator " << klName);
 
   if (pktType != m_pktType) {
-    BOOST_THROW_EXCEPTION(Error("Invalid packet type supplied (" +
-                                to_string(pktType) + " != " + to_string(m_pktType) + ")"));
+    NDN_THROW(Error("Invalid packet type supplied (" + to_string(pktType) +
+                    " != " + to_string(m_pktType) + ")"));
   }
 
   bool hasPendingResult = false;
@@ -102,7 +102,7 @@
 
   // Get rule.id
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "id")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <rule.id>"));
+    NDN_THROW(Error("Expecting <rule.id>"));
   }
 
   std::string ruleId = propertyIt->second.data();
@@ -110,7 +110,7 @@
 
   // Get rule.for
   if (propertyIt == configSection.end() || !boost::iequals(propertyIt->first, "for")) {
-    BOOST_THROW_EXCEPTION(Error("Expecting <rule.for> in rule: " + ruleId));
+    NDN_THROW(Error("Expecting <rule.for> in rule: " + ruleId));
   }
 
   std::string usage = propertyIt->second.data();
@@ -124,7 +124,7 @@
     isForData = false;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("Unrecognized <rule.for>: " + usage + " in rule: " + ruleId));
+    NDN_THROW(Error("Unrecognized <rule.for>: " + usage + " in rule: " + ruleId));
   }
 
   auto rule = make_unique<Rule>(ruleId, isForData ? tlv::Data : tlv::Interest);
@@ -135,7 +135,7 @@
       if (boost::iequals(propertyIt->first, "checker")) {
         break;
       }
-      BOOST_THROW_EXCEPTION(Error("Expecting <rule.filter> in rule: " + ruleId));
+      NDN_THROW(Error("Expecting <rule.filter> in rule: " + ruleId));
     }
 
     rule->addFilter(Filter::create(propertyIt->second, configFilename));
@@ -145,7 +145,7 @@
   bool hasCheckers = false;
   for (; propertyIt != configSection.end(); propertyIt++) {
     if (!boost::iequals(propertyIt->first, "checker")) {
-      BOOST_THROW_EXCEPTION(Error("Expecting <rule.checker> in rule: " + ruleId));
+      NDN_THROW(Error("Expecting <rule.checker> in rule: " + ruleId));
     }
 
     rule->addChecker(Checker::create(propertyIt->second, configFilename));
@@ -153,11 +153,11 @@
   }
 
   if (propertyIt != configSection.end()) {
-    BOOST_THROW_EXCEPTION(Error("Expecting end of <rule>: " + ruleId));
+    NDN_THROW(Error("Expecting end of <rule>: " + ruleId));
   }
 
   if (!hasCheckers) {
-    BOOST_THROW_EXCEPTION(Error("No <rule.checker> is specified in rule: " + ruleId));
+    NDN_THROW(Error("No <rule.checker> is specified in rule: " + ruleId));
   }
 
   return rule;
diff --git a/ndn-cxx/security/validity-period.cpp b/ndn-cxx/security/validity-period.cpp
index e928634..435056c 100644
--- a/ndn-cxx/security/validity-period.cpp
+++ b/ndn-cxx/security/validity-period.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -96,23 +96,23 @@
 ValidityPeriod::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"));
   }
 
   m_wire = wire;
   m_wire.parse();
 
   if (m_wire.type() != tlv::ValidityPeriod)
-    BOOST_THROW_EXCEPTION(Error("Unexpected TLV type when decoding ValidityPeriod"));
+    NDN_THROW(Error("ValidityPeriod", m_wire.type()));
 
   if (m_wire.elements_size() != 2)
-    BOOST_THROW_EXCEPTION(Error("Does not have two sub-TLVs"));
+    NDN_THROW(Error("ValidityPeriod does not have two sub-TLVs"));
 
   if (m_wire.elements()[NOT_BEFORE_OFFSET].type() != tlv::NotBefore ||
       m_wire.elements()[NOT_BEFORE_OFFSET].value_size() != ISO_DATETIME_SIZE ||
       m_wire.elements()[NOT_AFTER_OFFSET].type() != tlv::NotAfter ||
       m_wire.elements()[NOT_AFTER_OFFSET].value_size() != ISO_DATETIME_SIZE) {
-    BOOST_THROW_EXCEPTION(Error("Invalid NotBefore or NotAfter field"));
+    NDN_THROW(Error("Invalid NotBefore or NotAfter field"));
   }
 
   try {
@@ -122,7 +122,7 @@
                    time::fromIsoString(readString(m_wire.elements()[NOT_AFTER_OFFSET])));
   }
   catch (const std::bad_cast&) {
-    BOOST_THROW_EXCEPTION(Error("Invalid date format in NOT-BEFORE or NOT-AFTER field"));
+    NDN_THROW(Error("Invalid date format in NOT-BEFORE or NOT-AFTER field"));
   }
 }
 
diff --git a/ndn-cxx/selectors.cpp b/ndn-cxx/selectors.cpp
index e1b4722..c972441 100644
--- a/ndn-cxx/selectors.cpp
+++ b/ndn-cxx/selectors.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -131,7 +131,7 @@
 Selectors::wireDecode(const Block& wire)
 {
   if (wire.type() != tlv::Selectors)
-    BOOST_THROW_EXCEPTION(tlv::Error("Unexpected TLV type when decoding Selectors"));
+    NDN_THROW(tlv::Error("Selectors", wire.type()));
 
   *this = Selectors();
 
@@ -214,7 +214,7 @@
 Selectors::setChildSelector(int childSelector)
 {
   if (childSelector != 0 && childSelector != 1) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("ChildSelector must be 0 or 1"));
+    NDN_THROW(std::invalid_argument("ChildSelector must be 0 or 1"));
   }
   m_childSelector = childSelector;
   m_wire.reset();
diff --git a/ndn-cxx/signature-info.cpp b/ndn-cxx/signature-info.cpp
index fe372c2..41f1cb2 100644
--- a/ndn-cxx/signature-info.cpp
+++ b/ndn-cxx/signature-info.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -61,7 +61,7 @@
 SignatureInfo::wireEncode(EncodingImpl<TAG>& encoder) const
 {
   if (m_type == -1) {
-    BOOST_THROW_EXCEPTION(Error("Cannot encode invalid SignatureInfo"));
+    NDN_THROW(Error("Cannot encode invalid SignatureInfo"));
   }
 
   // SignatureInfo ::= SIGNATURE-INFO-TLV TLV-LENGTH
@@ -116,13 +116,13 @@
   m_wire.parse();
 
   if (m_wire.type() != tlv::SignatureInfo)
-    BOOST_THROW_EXCEPTION(Error("Decoding SignatureInfo, but TLV-TYPE is " + to_string(m_wire.type())));
+    NDN_THROW(Error("SignatureInfo", m_wire.type()));
 
   auto it = m_wire.elements_begin();
 
   // the first sub-element must be SignatureType
   if (it == m_wire.elements_end() || it->type() != tlv::SignatureType)
-    BOOST_THROW_EXCEPTION(Error("Missing SignatureType in SignatureInfo"));
+    NDN_THROW(Error("Missing SignatureType in SignatureInfo"));
 
   m_type = readNonNegativeIntegerAs<tlv::SignatureTypeValue>(*it);
   ++it;
@@ -154,7 +154,7 @@
   if (m_hasKeyLocator)
     return m_keyLocator;
   else
-    BOOST_THROW_EXCEPTION(Error("KeyLocator does not exist in SignatureInfo"));
+    NDN_THROW(Error("KeyLocator does not exist in SignatureInfo"));
 }
 
 void
@@ -177,7 +177,7 @@
 SignatureInfo::getValidityPeriod() const
 {
   if (m_otherTlvs.empty() || m_otherTlvs.front().type() != tlv::ValidityPeriod) {
-    BOOST_THROW_EXCEPTION(Error("ValidityPeriod does not exist in SignatureInfo"));
+    NDN_THROW(Error("ValidityPeriod does not exist in SignatureInfo"));
   }
 
   return security::ValidityPeriod(m_otherTlvs.front());
@@ -207,7 +207,7 @@
       return block;
   }
 
-  BOOST_THROW_EXCEPTION(Error("TLV-TYPE " + to_string(type) + " sub-element does not exist in SignatureInfo"));
+  NDN_THROW(Error("TLV-TYPE " + to_string(type) + " sub-element does not exist in SignatureInfo"));
 }
 
 void
diff --git a/ndn-cxx/signature.cpp b/ndn-cxx/signature.cpp
index c537c60..6c4787c 100644
--- a/ndn-cxx/signature.cpp
+++ b/ndn-cxx/signature.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -44,7 +44,7 @@
 Signature::getType() const
 {
   if (!*this) {
-    BOOST_THROW_EXCEPTION(Error("Signature is invalid"));
+    NDN_THROW(Error("Signature is invalid"));
   }
   return static_cast<tlv::SignatureTypeValue>(m_info.getSignatureType());
 }
@@ -59,7 +59,7 @@
 Signature::setValue(const Block& value)
 {
   if (value.type() != tlv::SignatureValue) {
-    BOOST_THROW_EXCEPTION(Error("Expecting SignatureValue, but TLV-TYPE is " + to_string(value.type())));
+    NDN_THROW(Error("SignatureValue", value.type()));
   }
   m_value = value;
 }
diff --git a/ndn-cxx/transport/detail/stream-transport-impl.hpp b/ndn-cxx/transport/detail/stream-transport-impl.hpp
index dda33e9..944b743 100644
--- a/ndn-cxx/transport/detail/stream-transport-impl.hpp
+++ b/ndn-cxx/transport/detail/stream-transport-impl.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -145,7 +145,7 @@
     else {
       m_transport.m_isConnected = false;
       m_transport.close();
-      BOOST_THROW_EXCEPTION(Transport::Error(error, "error while connecting to the forwarder"));
+      NDN_THROW(Transport::Error(error, "error while connecting to the forwarder"));
     }
   }
 
@@ -156,7 +156,7 @@
       return;
 
     m_transport.close();
-    BOOST_THROW_EXCEPTION(Transport::Error(error, "error while connecting to the forwarder"));
+    NDN_THROW(Transport::Error(error, "error while connecting to the forwarder"));
   }
 
   void
@@ -190,7 +190,7 @@
       }
 
       m_transport.close();
-      BOOST_THROW_EXCEPTION(Transport::Error(error, "error while sending data to socket"));
+      NDN_THROW(Transport::Error(error, "error while sending data to socket"));
     }
 
     if (!m_transport.m_isConnected) {
@@ -222,7 +222,7 @@
       }
 
       m_transport.close();
-      BOOST_THROW_EXCEPTION(Transport::Error(error, "error while receiving data from socket"));
+      NDN_THROW(Transport::Error(error, "error while receiving data from socket"));
     }
 
     m_inputBufferSize += nBytesRecvd;
@@ -232,9 +232,8 @@
     bool hasProcessedSome = processAllReceived(m_inputBuffer, offset, m_inputBufferSize);
     if (!hasProcessedSome && m_inputBufferSize == MAX_NDN_PACKET_SIZE && offset == 0) {
       m_transport.close();
-      BOOST_THROW_EXCEPTION(Transport::Error(boost::system::error_code(),
-                                             "input buffer full, but a valid TLV cannot be "
-                                             "decoded"));
+      NDN_THROW(Transport::Error(boost::system::error_code(),
+                                 "input buffer full, but a valid TLV cannot be decoded"));
     }
 
     if (offset > 0) {
diff --git a/ndn-cxx/transport/detail/stream-transport-with-resolver-impl.hpp b/ndn-cxx/transport/detail/stream-transport-with-resolver-impl.hpp
index 6ca3b1e..986eb57 100644
--- a/ndn-cxx/transport/detail/stream-transport-with-resolver-impl.hpp
+++ b/ndn-cxx/transport/detail/stream-transport-with-resolver-impl.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -69,13 +69,13 @@
       if (error == boost::system::errc::operation_canceled)
         return;
 
-      BOOST_THROW_EXCEPTION(Transport::Error(error, "Error during resolution of host or port"));
+      NDN_THROW(Transport::Error(error, "Error during resolution of host or port"));
     }
 
     typename Protocol::resolver::iterator end;
     if (endpoint == end) {
       this->m_transport.close();
-      BOOST_THROW_EXCEPTION(Transport::Error(error, "Unable to resolve host or port"));
+      NDN_THROW(Transport::Error(error, "Unable to resolve host or port"));
     }
 
     this->m_socket.async_connect(*endpoint, bind(&Impl::connectHandler, this->shared_from_this(), _1));
diff --git a/ndn-cxx/transport/tcp-transport.cpp b/ndn-cxx/transport/tcp-transport.cpp
index 30a5087..0b78b19 100644
--- a/ndn-cxx/transport/tcp-transport.cpp
+++ b/ndn-cxx/transport/tcp-transport.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -59,7 +59,7 @@
 
     const std::string scheme = uri.getScheme();
     if (scheme != "tcp" && scheme != "tcp4" && scheme != "tcp6") {
-      BOOST_THROW_EXCEPTION(Error("Cannot create TcpTransport from \"" + scheme + "\" URI"));
+      NDN_THROW(Error("Cannot create TcpTransport from \"" + scheme + "\" URI"));
     }
 
     if (!uri.getHost().empty()) {
@@ -71,7 +71,7 @@
     }
   }
   catch (const FaceUri::Error& error) {
-    BOOST_THROW_EXCEPTION(Error(error.what()));
+    NDN_THROW_NESTED(Error(error.what()));
   }
 
   return {host, port};
diff --git a/ndn-cxx/transport/transport.cpp b/ndn-cxx/transport/transport.cpp
index b6dac08..23895b0 100644
--- a/ndn-cxx/transport/transport.cpp
+++ b/ndn-cxx/transport/transport.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -28,11 +28,6 @@
 {
 }
 
-Transport::Error::Error(const std::string& msg)
-  : std::runtime_error(msg)
-{
-}
-
 Transport::Transport()
   : m_ioService(nullptr)
   , m_isConnected(false)
diff --git a/ndn-cxx/transport/transport.hpp b/ndn-cxx/transport/transport.hpp
index daede21..6954686 100644
--- a/ndn-cxx/transport/transport.hpp
+++ b/ndn-cxx/transport/transport.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -38,10 +38,9 @@
   class Error : public std::runtime_error
   {
   public:
-    Error(const boost::system::error_code& code, const std::string& msg);
+    using std::runtime_error::runtime_error;
 
-    explicit
-    Error(const std::string& msg);
+    Error(const boost::system::error_code& code, const std::string& msg);
   };
 
   typedef function<void(const Block& wire)> ReceiveCallback;
diff --git a/ndn-cxx/transport/unix-transport.cpp b/ndn-cxx/transport/unix-transport.cpp
index d444e35..b33704c 100644
--- a/ndn-cxx/transport/unix-transport.cpp
+++ b/ndn-cxx/transport/unix-transport.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -52,8 +52,7 @@
     const FaceUri uri(uriString);
 
     if (uri.getScheme() != "unix") {
-      BOOST_THROW_EXCEPTION(Error("Cannot create UnixTransport from \"" +
-                                  uri.getScheme() + "\" URI"));
+      NDN_THROW(Error("Cannot create UnixTransport from \"" + uri.getScheme() + "\" URI"));
     }
 
     if (!uri.getPath().empty()) {
@@ -61,7 +60,7 @@
     }
   }
   catch (const FaceUri::Error& error) {
-    BOOST_THROW_EXCEPTION(Error(error.what()));
+    NDN_THROW_NESTED(Error(error.what()));
   }
 
   return path;
diff --git a/ndn-cxx/util/config-file.cpp b/ndn-cxx/util/config-file.cpp
index b057ded..f08d3eb 100644
--- a/ndn-cxx/util/config-file.cpp
+++ b/ndn-cxx/util/config-file.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -105,21 +105,18 @@
 ConfigFile::parse()
 {
   if (m_path.empty()) {
-    BOOST_THROW_EXCEPTION(Error("Failed to locate configuration file for parsing"));
+    NDN_THROW(Error("Failed to locate configuration file for parsing"));
   }
   if (!m_input.is_open() && !open()) {
-    BOOST_THROW_EXCEPTION(Error("Failed to open configuration file for parsing"));
+    NDN_THROW(Error("Failed to open configuration file for parsing"));
   }
 
   try {
     boost::property_tree::read_ini(m_input, m_config);
   }
   catch (const boost::property_tree::ini_parser_error& error) {
-    std::ostringstream msg;
-    msg << "Failed to parse configuration file";
-    msg << " " << m_path;
-    msg << " " << error.message() << " line " << error.line();
-    BOOST_THROW_EXCEPTION(Error(msg.str()));
+    NDN_THROW(Error("Failed to parse configuration file " + error.filename() +
+                    " line " + to_string(error.line()) + ": " + error.message()));
   }
   return m_config;
 }
diff --git a/ndn-cxx/util/dummy-client-face.cpp b/ndn-cxx/util/dummy-client-face.cpp
index 6629757..9f2cb9e 100644
--- a/ndn-cxx/util/dummy-client-face.cpp
+++ b/ndn-cxx/util/dummy-client-face.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -292,7 +292,7 @@
   if (m_bcastLink != nullptr && other.m_bcastLink != nullptr) {
     if (m_bcastLink != other.m_bcastLink) {
       // already on different links
-      BOOST_THROW_EXCEPTION(AlreadyLinkedError());
+      NDN_THROW(AlreadyLinkedError());
     }
   }
   else if (m_bcastLink == nullptr && other.m_bcastLink != nullptr) {
diff --git a/ndn-cxx/util/io.cpp b/ndn-cxx/util/io.cpp
index 6f8484e..ac9f2b7 100644
--- a/ndn-cxx/util/io.cpp
+++ b/ndn-cxx/util/io.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -79,11 +79,11 @@
         t::bufferSource(block.wire(), block.size()) >> t::hexEncode(true) >> t::streamSink(os);
         break;
       default:
-        BOOST_THROW_EXCEPTION(Error("unrecognized IoEncoding"));
+        NDN_THROW(Error("Unknown IoEncoding " + to_string(encoding)));
     }
   }
-  catch (const t::Error& e) {
-    BOOST_THROW_EXCEPTION(Error(e.what()));
+  catch (const t::Error&) {
+    NDN_THROW_NESTED(Error("Transform error during save"));
   }
 }
 
diff --git a/ndn-cxx/util/io.hpp b/ndn-cxx/util/io.hpp
index 9b2d04a..e8f6e8d 100644
--- a/ndn-cxx/util/io.hpp
+++ b/ndn-cxx/util/io.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -140,8 +140,8 @@
   try {
     block = obj.wireEncode();
   }
-  catch (const tlv::Error& e) {
-    BOOST_THROW_EXCEPTION(Error(e.what()));
+  catch (const tlv::Error&) {
+    NDN_THROW_NESTED(Error("Encode error during save"));
   }
 
   saveBlock(block, os, encoding);
diff --git a/ndn-cxx/util/logger.cpp b/ndn-cxx/util/logger.cpp
index b8a0b43..5f6c2de 100644
--- a/ndn-cxx/util/logger.cpp
+++ b/ndn-cxx/util/logger.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -53,7 +53,7 @@
     return os << "ALL";
   }
 
-  BOOST_THROW_EXCEPTION(std::invalid_argument("unknown log level " + to_string(static_cast<int>(level))));
+  NDN_THROW(std::invalid_argument("unknown log level " + to_string(static_cast<int>(level))));
 }
 
 LogLevel
@@ -76,7 +76,7 @@
   else if (s == "ALL")
     return LogLevel::ALL;
 
-  BOOST_THROW_EXCEPTION(std::invalid_argument("unrecognized log level '" + s + "'"));
+  NDN_THROW(std::invalid_argument("unrecognized log level '" + s + "'"));
 }
 
 /**
@@ -104,7 +104,7 @@
   : m_moduleName(name)
 {
   if (!isValidLoggerName(m_moduleName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Logger name '" + m_moduleName + "' is invalid"));
+    NDN_THROW(std::invalid_argument("Logger name '" + m_moduleName + "' is invalid"));
   }
   this->setLevel(LogLevel::NONE);
   Logging::get().addLoggerImpl(*this);
@@ -115,7 +115,7 @@
 {
   std::string moduleName(name);
   if (!isValidLoggerName(moduleName)) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("Logger name '" + moduleName + "' is invalid"));
+    NDN_THROW(std::invalid_argument("Logger name '" + moduleName + "' is invalid"));
   }
   Logging::get().registerLoggerNameImpl(std::move(moduleName));
 }
diff --git a/ndn-cxx/util/logging.cpp b/ndn-cxx/util/logging.cpp
index e913c15..5f19548 100644
--- a/ndn-cxx/util/logging.cpp
+++ b/ndn-cxx/util/logging.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -181,7 +181,7 @@
   while (std::getline(ss, configModule, ':')) {
     size_t ind = configModule.find('=');
     if (ind == std::string::npos) {
-      BOOST_THROW_EXCEPTION(std::invalid_argument("malformed logging config: '=' is missing"));
+      NDN_THROW(std::invalid_argument("malformed logging config: '=' is missing"));
     }
 
     std::string moduleName = configModule.substr(0, ind);
diff --git a/ndn-cxx/util/random.cpp b/ndn-cxx/util/random.cpp
index 92a5f32..5ff643e 100644
--- a/ndn-cxx/util/random.cpp
+++ b/ndn-cxx/util/random.cpp
@@ -45,8 +45,8 @@
 generateSecureBytes(uint8_t* bytes, size_t size)
 {
   if (RAND_bytes(bytes, size) != 1) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Failed to generate random bytes (error code " +
-                                             to_string(ERR_get_error()) + ")"));
+    NDN_THROW(std::runtime_error("Failed to generate random bytes (error code " +
+                                 to_string(ERR_get_error()) + ")"));
   }
 }
 
diff --git a/ndn-cxx/util/regex/regex-backref-matcher.cpp b/ndn-cxx/util/regex/regex-backref-matcher.cpp
index 0a95c32..0b531ce 100644
--- a/ndn-cxx/util/regex/regex-backref-matcher.cpp
+++ b/ndn-cxx/util/regex/regex-backref-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -36,7 +36,7 @@
 RegexBackrefMatcher::compile()
 {
   if (m_expr.size() < 2)
-    BOOST_THROW_EXCEPTION(Error("Unrecognized format: " + m_expr));
+    NDN_THROW(Error("Unrecognized format: " + m_expr));
 
   size_t lastIndex = m_expr.size() - 1;
   if ('(' == m_expr[0] && ')' == m_expr[lastIndex]) {
@@ -44,7 +44,7 @@
                                                               m_backrefManager));
   }
   else
-    BOOST_THROW_EXCEPTION(Error("Unrecognized format: " + m_expr));
+    NDN_THROW(Error("Unrecognized format: " + m_expr));
 }
 
 } // namespace ndn
diff --git a/ndn-cxx/util/regex/regex-component-matcher.cpp b/ndn-cxx/util/regex/regex-component-matcher.cpp
index 037710d..604c0ee 100644
--- a/ndn-cxx/util/regex/regex-component-matcher.cpp
+++ b/ndn-cxx/util/regex/regex-component-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -60,7 +60,7 @@
   }
 
   if (!m_isExactMatch)
-    BOOST_THROW_EXCEPTION(Error("Non-exact component search is not supported yet"));
+    NDN_THROW(Error("Non-exact component search is not supported yet"));
 
   std::smatch subResult;
   std::string targetStr = name.get(offset).toUri();
diff --git a/ndn-cxx/util/regex/regex-component-set-matcher.cpp b/ndn-cxx/util/regex/regex-component-set-matcher.cpp
index a1b0747..6c2eca8 100644
--- a/ndn-cxx/util/regex/regex-component-set-matcher.cpp
+++ b/ndn-cxx/util/regex/regex-component-set-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -38,7 +38,7 @@
 RegexComponentSetMatcher::compile()
 {
   if (m_expr.size() < 2)
-    BOOST_THROW_EXCEPTION(Error("Regexp compile error (cannot parse " + m_expr + ")"));
+    NDN_THROW(Error("Regexp compile error (cannot parse " + m_expr + ")"));
 
   switch (m_expr[0]) {
     case '<':
@@ -46,7 +46,7 @@
     case '[': {
       size_t lastIndex = m_expr.size() - 1;
       if (']' != m_expr[lastIndex])
-        BOOST_THROW_EXCEPTION(Error("Regexp compile error (no matching ']' in " + m_expr + ")"));
+        NDN_THROW(Error("Regexp compile error (no matching ']' in " + m_expr + ")"));
 
       if ('^' == m_expr[1]) {
         m_isInclusion = false;
@@ -57,7 +57,7 @@
       break;
     }
     default:
-      BOOST_THROW_EXCEPTION(Error("Regexp compile error (cannot parse " + m_expr + ")"));
+      NDN_THROW(Error("Regexp compile error (cannot parse " + m_expr + ")"));
   }
 }
 
@@ -66,7 +66,7 @@
 {
   size_t end = extractComponent(1);
   if (m_expr.size() != end)
-    BOOST_THROW_EXCEPTION(Error("Component expr error " + m_expr));
+    NDN_THROW(Error("Component expr error " + m_expr));
 
   m_components.push_back(make_shared<RegexComponentMatcher>(m_expr.substr(1, end - 2), m_backrefManager));
 }
@@ -79,7 +79,7 @@
 
   while (index < lastIndex) {
     if ('<' != m_expr[index])
-      BOOST_THROW_EXCEPTION(Error("Component expr error " + m_expr));
+      NDN_THROW(Error("Component expr error " + m_expr));
 
     tempIndex = index + 1;
     index = extractComponent(tempIndex);
@@ -88,7 +88,7 @@
   }
 
   if (index != lastIndex)
-    BOOST_THROW_EXCEPTION(Error("Not sufficient expr to parse " + m_expr));
+    NDN_THROW(Error("Not sufficient expr to parse " + m_expr));
 }
 
 bool
@@ -131,7 +131,7 @@
         rcount++;
         break;
       case 0:
-        BOOST_THROW_EXCEPTION(Error("Square brackets mismatch"));
+        NDN_THROW(Error("Square brackets mismatch"));
         break;
     }
     index++;
diff --git a/ndn-cxx/util/regex/regex-pattern-list-matcher.cpp b/ndn-cxx/util/regex/regex-pattern-list-matcher.cpp
index 1923875..a0464c3 100644
--- a/ndn-cxx/util/regex/regex-pattern-list-matcher.cpp
+++ b/ndn-cxx/util/regex/regex-pattern-list-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -45,7 +45,7 @@
     subHead = index;
 
     if (!extractPattern(subHead, &index))
-      BOOST_THROW_EXCEPTION(Error("Compile error"));
+      NDN_THROW(Error("Compile error"));
   }
 }
 
@@ -93,7 +93,7 @@
     break;
 
   default:
-    BOOST_THROW_EXCEPTION(Error("Unexpected syntax"));
+    NDN_THROW(Error("Unexpected character "s + m_expr[index]));
   }
 
   *next = end;
@@ -108,7 +108,7 @@
 
   while (lcount > rcount) {
     if (index >= m_expr.size())
-      BOOST_THROW_EXCEPTION(Error("Parenthesis mismatch"));
+      NDN_THROW(Error("Parenthesis mismatch"));
 
     if (left == m_expr[index])
       lcount++;
@@ -141,7 +141,7 @@
         break;
     }
     if (index == exprSize)
-      BOOST_THROW_EXCEPTION(Error("Missing right brace bracket"));
+      NDN_THROW(Error("Missing closing brace"));
     else
       return ++index;
   }
diff --git a/ndn-cxx/util/regex/regex-repeat-matcher.cpp b/ndn-cxx/util/regex/regex-repeat-matcher.cpp
index 882991a..159dc41 100644
--- a/ndn-cxx/util/regex/regex-repeat-matcher.cpp
+++ b/ndn-cxx/util/regex/regex-repeat-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -111,10 +111,10 @@
       max = min;
     }
     else
-      BOOST_THROW_EXCEPTION(Error("RegexRepeatMatcher::parseRepetition(): Unrecognized format " + m_expr));
+      NDN_THROW(Error("parseRepetition: unrecognized format " + m_expr));
 
     if (min > MAX_REPETITIONS || max > MAX_REPETITIONS || min > max)
-      BOOST_THROW_EXCEPTION(Error("RegexRepeatMatcher::parseRepetition(): Wrong number " + m_expr));
+      NDN_THROW(Error("parseRepetition: wrong number " + m_expr));
 
     m_repeatMin = min;
     m_repeatMax = max;
diff --git a/ndn-cxx/util/regex/regex-top-matcher.cpp b/ndn-cxx/util/regex/regex-top-matcher.cpp
index e2c4209..f326ca5 100644
--- a/ndn-cxx/util/regex/regex-top-matcher.cpp
+++ b/ndn-cxx/util/regex/regex-top-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -118,7 +118,7 @@
           result.append(i);
       }
       else
-        BOOST_THROW_EXCEPTION(Error("Exceed the range of back reference"));
+        NDN_THROW(Error("Exceeded the range of back reference"));
     }
   }
 
@@ -133,22 +133,22 @@
   if (expand[offset] == '\\') {
     offset++;
     if (offset >= expand.size())
-      BOOST_THROW_EXCEPTION(Error("Wrong format of expand string"));
+      NDN_THROW(Error("Wrong format of expand string"));
 
     while (expand[offset] <= '9' and expand[offset] >= '0') {
       offset++;
       if (offset > expand.size())
-        BOOST_THROW_EXCEPTION(Error("Wrong format of expand string"));
+        NDN_THROW(Error("Wrong format of expand string"));
     }
     if (offset > begin + 1)
       return expand.substr(begin, offset - begin);
     else
-      BOOST_THROW_EXCEPTION(Error("Wrong format of expand string"));
+      NDN_THROW(Error("Wrong format of expand string"));
   }
   else if (expand[offset] == '<') {
     offset++;
     if (offset >= expand.size())
-      BOOST_THROW_EXCEPTION(Error("Wrong format of expand string"));
+      NDN_THROW(Error("Wrong format of expand string"));
 
     size_t left = 1;
     size_t right = 0;
@@ -159,12 +159,12 @@
         right++;
       offset++;
       if (offset >= expand.size())
-        BOOST_THROW_EXCEPTION(Error("Wrong format of expand string"));
+        NDN_THROW(Error("Wrong format of expand string"));
     }
     return expand.substr(begin, offset - begin);
   }
   else
-    BOOST_THROW_EXCEPTION(Error("Wrong format of expand string"));
+    NDN_THROW(Error("Wrong format of expand string"));
 }
 
 shared_ptr<RegexTopMatcher>
diff --git a/ndn-cxx/util/segment-fetcher.cpp b/ndn-cxx/util/segment-fetcher.cpp
index 2d70aee..09cfd4e 100644
--- a/ndn-cxx/util/segment-fetcher.cpp
+++ b/ndn-cxx/util/segment-fetcher.cpp
@@ -1,8 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2019, Regents of the University of California,
- *                          Colorado State University,
- *                          University Pierre & Marie Curie, Sorbonne University.
+ * Copyright (c) 2013-2019 Regents of the University of California,
+ *                         Colorado State University,
+ *                         University Pierre & Marie Curie, Sorbonne University.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -46,19 +46,19 @@
 SegmentFetcher::Options::validate()
 {
   if (maxTimeout < 1_ms) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("maxTimeout must be greater than or equal to 1 millisecond"));
+    NDN_THROW(std::invalid_argument("maxTimeout must be greater than or equal to 1 millisecond"));
   }
 
   if (initCwnd < 1.0) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("initCwnd must be greater than or equal to 1"));
+    NDN_THROW(std::invalid_argument("initCwnd must be greater than or equal to 1"));
   }
 
   if (aiStep < 0.0) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("aiStep must be greater than or equal to 0"));
+    NDN_THROW(std::invalid_argument("aiStep must be greater than or equal to 0"));
   }
 
   if (mdCoef < 0.0 || mdCoef > 1.0) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument("mdCoef must be in range [0, 1]"));
+    NDN_THROW(std::invalid_argument("mdCoef must be in range [0, 1]"));
   }
 }
 
diff --git a/ndn-cxx/util/segment-fetcher.hpp b/ndn-cxx/util/segment-fetcher.hpp
index 9a3d5fd..9b7f5bb 100644
--- a/ndn-cxx/util/segment-fetcher.hpp
+++ b/ndn-cxx/util/segment-fetcher.hpp
@@ -1,8 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2019, Regents of the University of California,
- *                          Colorado State University,
- *                          University Pierre & Marie Curie, Sorbonne University.
+ * Copyright (c) 2013-2019 Regents of the University of California,
+ *                         Colorado State University,
+ *                         University Pierre & Marie Curie, Sorbonne University.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
diff --git a/ndn-cxx/util/sha256.cpp b/ndn-cxx/util/sha256.cpp
index 6580114..3575884 100644
--- a/ndn-cxx/util/sha256.cpp
+++ b/ndn-cxx/util/sha256.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -118,7 +118,7 @@
 Sha256::update(const uint8_t* buffer, size_t size)
 {
   if (m_isFinalized)
-    BOOST_THROW_EXCEPTION(Error("Digest has been already finalized"));
+    NDN_THROW(Error("Digest has been already finalized"));
 
   BOOST_ASSERT(m_input != nullptr);
   m_input->write(buffer, size);
diff --git a/ndn-cxx/util/sqlite3-statement.cpp b/ndn-cxx/util/sqlite3-statement.cpp
index 1b2e9eb..4426a02 100644
--- a/ndn-cxx/util/sqlite3-statement.cpp
+++ b/ndn-cxx/util/sqlite3-statement.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -35,7 +35,7 @@
 {
   int res = sqlite3_prepare_v2(database, statement.data(), -1, &m_stmt, nullptr);
   if (res != SQLITE_OK)
-    BOOST_THROW_EXCEPTION(std::domain_error("bad SQL statement: " + statement));
+    NDN_THROW(std::domain_error("bad SQL statement: " + statement));
 }
 
 int
diff --git a/ndn-cxx/util/string-helper.cpp b/ndn-cxx/util/string-helper.cpp
index 184458d..06b08a6 100644
--- a/ndn-cxx/util/string-helper.cpp
+++ b/ndn-cxx/util/string-helper.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -87,7 +87,7 @@
     tr::bufferSource(hexString) >> tr::hexDecode() >> tr::streamSink(os);
   }
   catch (const tr::Error& e) {
-    BOOST_THROW_EXCEPTION(StringHelperError("Conversion from hex failed: "s + e.what()));
+    NDN_THROW_NESTED(StringHelperError("Conversion from hex failed: "s + e.what()));
   }
 
   return os.buf();
diff --git a/ndn-cxx/util/string-helper.hpp b/ndn-cxx/util/string-helper.hpp
index 59638cb..57c27fb 100644
--- a/ndn-cxx/util/string-helper.hpp
+++ b/ndn-cxx/util/string-helper.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -31,11 +31,7 @@
 class StringHelperError : public std::invalid_argument
 {
 public:
-  explicit
-  StringHelperError(const std::string& what)
-    : std::invalid_argument(what)
-  {
-  }
+  using std::invalid_argument::invalid_argument;
 };
 
 /**
diff --git a/tests/unit/lp/packet.t.cpp b/tests/unit/lp/packet.t.cpp
index a8b5819..30c8bae 100644
--- a/tests/unit/lp/packet.t.cpp
+++ b/tests/unit/lp/packet.t.cpp
@@ -44,7 +44,7 @@
   packet.set<FragIndexField>(1234);
   BOOST_CHECK(!packet.empty());
   BOOST_CHECK(packet.has<FragIndexField>());
-  BOOST_CHECK_THROW(packet.add<FragIndexField>(5678), std::length_error);
+  BOOST_CHECK_THROW(packet.add<FragIndexField>(5678), std::invalid_argument);
   BOOST_CHECK_EQUAL(packet.count<FragIndexField>(), 1);
   BOOST_CHECK_EQUAL(packet.get<FragIndexField>(0), 1234);
   BOOST_CHECK_THROW(packet.get<FragIndexField>(1), std::out_of_range);
diff --git a/tests/unit/mgmt/dispatcher.t.cpp b/tests/unit/mgmt/dispatcher.t.cpp
index c24f9cf..7fa74e5 100644
--- a/tests/unit/mgmt/dispatcher.t.cpp
+++ b/tests/unit/mgmt/dispatcher.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -68,7 +68,7 @@
   wireDecode(const Block& wire) final
   {
     if (wire.type() != 128)
-      BOOST_THROW_EXCEPTION(tlv::Error("Expecting TLV type 128"));
+      NDN_THROW(tlv::Error("Expecting TLV type 128"));
   }
 };
 
diff --git a/tests/unit/util/io.t.cpp b/tests/unit/util/io.t.cpp
index 052e149..f8595c9 100644
--- a/tests/unit/util/io.t.cpp
+++ b/tests/unit/util/io.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -93,7 +93,7 @@
   wireEncode() const
   {
     if (shouldThrow) {
-      BOOST_THROW_EXCEPTION(tlv::Error("encode error"));
+      NDN_THROW(tlv::Error("encode error"));
     }
 
     // block will be 0xAA, 0x01, 0xDD
@@ -120,7 +120,7 @@
   wireDecode(const Block& block)
   {
     if (m_shouldThrow) {
-      BOOST_THROW_EXCEPTION(tlv::Error("decode error"));
+      NDN_THROW(tlv::Error("decode error"));
     }
 
     // block must be 0xBB, 0x01, 0xEE
diff --git a/tests/unit/util/scheduler.t.cpp b/tests/unit/util/scheduler.t.cpp
index 49c90b6..d8335c4 100644
--- a/tests/unit/util/scheduler.t.cpp
+++ b/tests/unit/util/scheduler.t.cpp
@@ -85,7 +85,12 @@
   class MyException : public std::exception
   {
   };
-  scheduler.scheduleEvent(10_ms, [] { BOOST_THROW_EXCEPTION(MyException()); });
+  scheduler.scheduleEvent(10_ms, [] {
+    // use plain 'throw' to ensure that Scheduler does not depend on the
+    // internal machinery of NDN_THROW and that it can catch all exceptions
+    // regardless of how they are thrown by the application
+    throw MyException{};
+  });
 
   bool isCallbackInvoked = false;
   scheduler.scheduleEvent(20_ms, [&isCallbackInvoked] { isCallbackInvoked = true; });
diff --git a/tests/unit/util/signal.t.cpp b/tests/unit/util/signal.t.cpp
index de22534..f0eb192 100644
--- a/tests/unit/util/signal.t.cpp
+++ b/tests/unit/util/signal.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -424,14 +424,17 @@
 {
   SignalOwner0 so;
 
-  struct HandlerError : public std::exception
+  class HandlerError : public std::exception
   {
   };
 
   int hit = 0;
   so.sig.connect([&] {
     ++hit;
-    BOOST_THROW_EXCEPTION(HandlerError());
+    // use plain 'throw' to ensure that Signal does not depend on the internal
+    // machinery of NDN_THROW and that it can catch all exceptions regardless
+    // of how they are thrown by the application
+    throw HandlerError{};
   });
 
   BOOST_CHECK_THROW(so.emitSignal(sig), HandlerError);
diff --git a/tests/unit/util/simple-notification.hpp b/tests/unit/util/simple-notification.hpp
index ac81f5f..431b8c2 100644
--- a/tests/unit/util/simple-notification.hpp
+++ b/tests/unit/util/simple-notification.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,
@@ -68,7 +68,7 @@
 
     // error for testing
     if (!m_message.empty() && m_message[0] == '\x07')
-      BOOST_THROW_EXCEPTION(tlv::Error("0x07 error"));
+      NDN_THROW(tlv::Error("0x07 error"));
   }
 
   const std::string&
diff --git a/tests/unit/util/time.t.cpp b/tests/unit/util/time.t.cpp
index 6ed55d5..3f5f531 100644
--- a/tests/unit/util/time.t.cpp
+++ b/tests/unit/util/time.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,6 +23,7 @@
 
 #include "tests/boost-test.hpp"
 
+#include <boost/lexical_cast.hpp>
 #include <thread>
 
 namespace ndn {
@@ -125,8 +126,10 @@
   auto year2042 = fromIsoString("20420101T000001.042000");
   auto year2010 = fromIsoString("20100101T000001.042000");
 
-  BOOST_CHECK_EQUAL(to_string(year2010), "1262304001042000000 nanoseconds since Jan 1, 1970");
-  BOOST_CHECK_EQUAL(to_string(year2042), "2272147201042000000 nanoseconds since Jan 1, 1970");
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(year2010),
+                    "1262304001042000000 nanoseconds since Jan 1, 1970");
+  BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(year2042),
+                    "2272147201042000000 nanoseconds since Jan 1, 1970");
   BOOST_CHECK_GT(year2042, year2010);
 }
 
diff --git a/tools/ndnsec/cert-install.cpp b/tools/ndnsec/cert-install.cpp
index 3ae6724..7bf17a0 100644
--- a/tools/ndnsec/cert-install.cpp
+++ b/tools/ndnsec/cert-install.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -51,7 +51,7 @@
 
   requestStream.connect(host, port);
   if (!requestStream) {
-    BOOST_THROW_EXCEPTION(HttpException("HTTP connection error"));
+    NDN_THROW(HttpException("HTTP connection error"));
   }
 
   requestStream << "GET " << path << " HTTP/1.0\r\n";
@@ -64,7 +64,7 @@
   std::string statusLine;
   std::getline(requestStream, statusLine);
   if (!requestStream) {
-    BOOST_THROW_EXCEPTION(HttpException("HTTP communication error"));
+    NDN_THROW(HttpException("HTTP communication error"));
   }
 
   std::stringstream responseStream(statusLine);
@@ -76,10 +76,10 @@
 
   std::getline(responseStream, statusMessage);
   if (!requestStream || httpVersion.substr(0, 5) != "HTTP/") {
-    BOOST_THROW_EXCEPTION(HttpException("HTTP communication error"));
+    NDN_THROW(HttpException("HTTP communication error"));
   }
   if (statusCode != 200) {
-    BOOST_THROW_EXCEPTION(HttpException("HTTP server error"));
+    NDN_THROW(HttpException("HTTP server error"));
   }
   std::string header;
   while (std::getline(requestStream, header) && header != "\r")
@@ -152,38 +152,37 @@
   }
 
   security::v2::Certificate cert;
-
   try {
-  if (certFileName.find("http://") == 0) {
-    std::string host;
-    std::string port;
-    std::string path;
+    if (certFileName.find("http://") == 0) {
+      std::string host;
+      std::string port;
+      std::string path;
 
-    size_t pos = 7; // offset of "http://"
-    size_t posSlash = certFileName.find("/", pos);
+      size_t pos = 7; // offset of "http://"
+      size_t posSlash = certFileName.find("/", pos);
 
-    if (posSlash == std::string::npos)
-      BOOST_THROW_EXCEPTION(HttpException("Request line is not correctly formatted"));
+      if (posSlash == std::string::npos)
+        NDN_THROW(HttpException("Request line is not correctly formatted"));
 
-    size_t posPort = certFileName.find(":", pos);
+      size_t posPort = certFileName.find(":", pos);
 
-    if (posPort != std::string::npos && posPort < posSlash) {
-      // port is specified
-      port = certFileName.substr(posPort + 1, posSlash - posPort - 1);
-      host = certFileName.substr(pos, posPort - pos);
+      if (posPort != std::string::npos && posPort < posSlash) {
+        // port is specified
+        port = certFileName.substr(posPort + 1, posSlash - posPort - 1);
+        host = certFileName.substr(pos, posPort - pos);
+      }
+      else {
+        port = "80";
+        host = certFileName.substr(pos, posSlash - pos);
+      }
+
+      path = certFileName.substr(posSlash, certFileName.size() - posSlash);
+
+      cert = getCertificateHttp(host, port, path);
     }
     else {
-      port = "80";
-      host = certFileName.substr(pos, posSlash - pos);
+      cert = loadCertificate(certFileName);
     }
-
-    path = certFileName.substr(posSlash, certFileName.size() - posSlash);
-
-    cert = getCertificateHttp(host, port, path);
-  }
-  else {
-    cert = loadCertificate(certFileName);
-  }
   }
   catch (const CannotLoadCertificate&) {
     std::cerr << "ERROR: Cannot load the certificate " << certFileName << std::endl;
diff --git a/tools/ndnsec/util.cpp b/tools/ndnsec/util.cpp
index 5e5c341..1a4b8f4 100644
--- a/tools/ndnsec/util.cpp
+++ b/tools/ndnsec/util.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2018 Regents of the University of California.
+ * Copyright (c) 2013-2019 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -75,7 +75,7 @@
     cert = io::load<security::v2::Certificate>(fileName);
 
   if (cert == nullptr) {
-    BOOST_THROW_EXCEPTION(CannotLoadCertificate(fileName));
+    NDN_THROW(CannotLoadCertificate(fileName));
   }
   return *cert;
 }
