diff --git a/daemon/face/datagram-face.hpp b/daemon/face/datagram-face.hpp
index 8050164..cbda459 100644
--- a/daemon/face/datagram-face.hpp
+++ b/daemon/face/datagram-face.hpp
@@ -233,37 +233,37 @@
                 << ",endpoint:" << m_socket->local_endpoint()
                 << "] Received: " << nBytesReceived << " bytes");
 
-  /// @todo Eliminate reliance on exceptions in this path
-  try {
-    Block element(buffer, nBytesReceived);
+  Block element;
+  bool isOk = Block::fromBuffer(buffer, nBytesReceived, element);
+  if (!isOk)
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Failed to parse incoming packet");
+      // This message won't extend the face lifetime
+      return;
+    }
 
-    if (element.size() != nBytesReceived)
-      {
-        NFD_LOG_WARN("[id:" << this->getId()
-                     << ",endpoint:" << m_socket->local_endpoint()
-                     << "] Received datagram size and decoded "
-                     << "element size don't match");
-        // This message won't extend the face lifetime
-        return;
-      }
-    if (!this->decodeAndDispatchInput(element))
-      {
-        NFD_LOG_WARN("[id:" << this->getId()
-                     << ",endpoint:" << m_socket->local_endpoint()
-                     << "] Received unrecognized block of type ["
-                     << element.type() << "]");
-        // ignore unknown packet and proceed
-        // This message won't extend the face lifetime
-        return;
-      }
-  }
-  catch(const tlv::Error& e) {
-    NFD_LOG_WARN("[id:" << this->getId()
-                 << ",endpoint:" << m_socket->local_endpoint()
-                 << "] Received input is invalid");
-    // This message won't extend the face lifetime
-    return;
-  }
+  if (element.size() != nBytesReceived)
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Received datagram size and decoded "
+                   << "element size don't match");
+      // This message won't extend the face lifetime
+      return;
+    }
+
+  if (!this->decodeAndDispatchInput(element))
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Received unrecognized block of type ["
+                   << element.type() << "]");
+      // This message won't extend the face lifetime
+      return;
+    }
+
   m_hasBeenUsedRecently = true;
 }
 
diff --git a/daemon/face/ethernet-face.cpp b/daemon/face/ethernet-face.cpp
index 7d87c0f..e619724 100644
--- a/daemon/face/ethernet-face.cpp
+++ b/daemon/face/ethernet-face.cpp
@@ -213,22 +213,24 @@
       NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
                     << "] Received: " << length << " bytes");
 
-      /// \todo Eliminate reliance on exceptions in this path
-      try {
-        /// \todo Reserve space in front and at the back
-        ///       of the underlying buffer
-        ndn::Block element(packet, length);
-        if (!decodeAndDispatchInput(element))
-          {
-            NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                         << "] Received unrecognized block of type " << element.type());
-            // ignore unknown packet
-          }
-      }
-      catch (const tlv::Error&) {
-        NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                     << "] Received block is invalid or too large to process");
-      }
+      /// \todo Reserve space in front and at the back
+      ///       of the underlying buffer
+      Block element;
+      bool isOk = Block::fromBuffer(packet, length, element);
+      if (isOk)
+        {
+          if (!decodeAndDispatchInput(element))
+            {
+              NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                           << "] Received unrecognized block of type " << element.type());
+              // ignore unknown packet
+            }
+        }
+      else
+        {
+          NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
+                       << "] Received block is invalid or too large to process");
+        }
     }
 
   m_socket->async_read_some(boost::asio::null_buffers(),
diff --git a/daemon/face/stream-face.hpp b/daemon/face/stream-face.hpp
index f6c008a..a1aa7c1 100644
--- a/daemon/face/stream-face.hpp
+++ b/daemon/face/stream-face.hpp
@@ -279,38 +279,40 @@
   // do magic
 
   std::size_t offset = 0;
-  /// @todo Eliminate reliance on exceptions in this path
-  try {
-    while(m_inputBufferSize - offset > 0)
-      {
-        Block element(m_inputBuffer + offset, m_inputBufferSize - offset);
-        offset += element.size();
 
-        BOOST_ASSERT(offset <= m_inputBufferSize);
+  bool isOk = true;
+  Block element;
+  while(m_inputBufferSize - offset > 0)
+    {
+      isOk = Block::fromBuffer(m_inputBuffer + offset, m_inputBufferSize - offset, element);
+      if (!isOk)
+        break;
 
-        if (!this->decodeAndDispatchInput(element))
-          {
-            NFD_LOG_WARN("[id:" << this->getId()
-                         << ",endpoint:" << m_socket->local_endpoint()
-                         << "] Received unrecognized block of type ["
-                         << element.type() << "]");
-            // ignore unknown packet and proceed
-          }
-      }
-  }
-  catch(const tlv::Error& e) {
-    if (m_inputBufferSize == MAX_NDN_PACKET_SIZE && offset == 0)
-      {
-        NFD_LOG_WARN("[id:" << this->getId()
-                     << ",endpoint:" << m_socket->local_endpoint()
-                     << "] Received input is invalid or too large to process, "
-                     << "closing down the face");
+      offset += element.size();
 
-        closeSocket();
-        this->onFail("Received input is invalid or too large to process, closing down the face");
-        return;
-      }
-  }
+      BOOST_ASSERT(offset <= m_inputBufferSize);
+
+      if (!this->decodeAndDispatchInput(element))
+        {
+          NFD_LOG_WARN("[id:" << this->getId()
+                       << ",endpoint:" << m_socket->local_endpoint()
+                       << "] Received unrecognized block of type ["
+                       << element.type() << "]");
+          // ignore unknown packet and proceed
+        }
+    }
+  if (!isOk && m_inputBufferSize == MAX_NDN_PACKET_SIZE && offset == 0)
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << ",endpoint:" << m_socket->local_endpoint()
+                   << "] Failed to parse incoming packet or it is too large to process, "
+                   << "closing down the face");
+
+      closeSocket();
+      this->onFail("Failed to parse incoming packet or it is too large to process, "
+                   "closing down the face");
+      return;
+    }
 
   if (offset > 0)
     {
