diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 855dd99..7997b1e 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -102,26 +102,30 @@
 void
 WebSocketChannel::handleOpen(websocketpp::connection_hdl hdl)
 {
-  std::string remote;
   try {
-    remote = "wsclient://" + m_server.get_con_from_hdl(hdl)->get_remote_endpoint();
+    std::string remote = "wsclient://" + m_server.get_con_from_hdl(hdl)->get_remote_endpoint();
+    auto face = make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
+                                           hdl, ref(m_server));
+    m_onFaceCreatedCallback(face);
+    m_channelFaces[hdl] = face;
+    // Schedule ping message
+    scheduler::EventId pingEvent = scheduler::schedule(m_pingInterval,
+                                                       bind(&WebSocketChannel::sendPing,
+                                                            this, hdl));
+    face->setPingEventId(pingEvent);
   }
-  catch (const websocketpp::lib::error_code& e) {
-    NFD_LOG_WARN("Cannot get remote URI");
-    websocketpp::lib::error_code error;
-    m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", error);
-    return;
+  catch (const FaceUri::Error& e) {
+    NFD_LOG_WARN(e.what());
+    websocketpp::lib::error_code ec;
+    m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", ec);
+    // ignore error on close
   }
-
-  auto face = make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
-                                         hdl, ref(m_server));
-  m_onFaceCreatedCallback(face);
-  m_channelFaces[hdl] = face;
-
-  // Schedule ping message
-  scheduler::EventId pingEvent = scheduler::schedule(m_pingInterval,
-                                                     bind(&WebSocketChannel::sendPing, this, hdl));
-  face->setPingEventId(pingEvent);
+  catch (const websocketpp::exception& e) {
+    NFD_LOG_WARN("Cannot get remote connection: " << e.what());
+    websocketpp::lib::error_code ec;
+    m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", ec);
+    // ignore error on close
+  }
 }
 
 void
@@ -131,19 +135,20 @@
   if (it != m_channelFaces.end()) {
     NFD_LOG_TRACE("Sending ping to " << it->second->getRemoteUri());
 
-    try {
-      m_server.ping(hdl, "NFD-WebSocket");
-    }
-    catch (const websocketpp::lib::error_code& e) {
-      NFD_LOG_WARN("Failed to ping " << it->second->getRemoteUri());
-      it->second->close();
-      m_channelFaces.erase(it);
-      return;
-    }
+    websocketpp::lib::error_code ec;
+    m_server.ping(hdl, "NFD-WebSocket", ec);
+    if (ec)
+      {
+        NFD_LOG_WARN("Failed to ping " << it->second->getRemoteUri() << ": " << ec.message());
+        it->second->close();
+        m_channelFaces.erase(it);
+        return;
+      }
 
     // Schedule next ping message
     scheduler::EventId pingEvent = scheduler::schedule(m_pingInterval,
-                                                       bind(&WebSocketChannel::sendPing, this, hdl));
+                                                       bind(&WebSocketChannel::sendPing,
+                                                            this, hdl));
     it->second->setPingEventId(pingEvent);
   }
 }
diff --git a/daemon/face/websocket-face.cpp b/daemon/face/websocket-face.cpp
index 007e800..4c781c3 100644
--- a/daemon/face/websocket-face.cpp
+++ b/daemon/face/websocket-face.cpp
@@ -54,13 +54,11 @@
   const Block& payload = interest.wireEncode();
   this->getMutableCounters().getNOutBytes() += payload.size();
 
-  try {
-    m_server.send(m_handle, payload.wire(), payload.size(),
-                  websocketpp::frame::opcode::binary);
-  }
-  catch (const websocketpp::lib::error_code& e) {
-    NFD_LOG_FACE_WARN("Failed to send Interest: " << e << " (" << e.message() << ")");
-  }
+  websocketpp::lib::error_code ec;
+  m_server.send(m_handle, payload.wire(), payload.size(),
+                websocketpp::frame::opcode::binary, ec);
+  if (ec)
+    NFD_LOG_FACE_WARN("Failed to send Interest: " << ec.message());
 }
 
 void
@@ -76,13 +74,11 @@
   const Block& payload = data.wireEncode();
   this->getMutableCounters().getNOutBytes() += payload.size();
 
-  try {
-    m_server.send(m_handle, payload.wire(), payload.size(),
-                  websocketpp::frame::opcode::binary);
-  }
-  catch (const websocketpp::lib::error_code& e) {
-    NFD_LOG_FACE_WARN("Failed to send Data: " << e << " (" << e.message() << ")");
-  }
+  websocketpp::lib::error_code ec;
+  m_server.send(m_handle, payload.wire(), payload.size(),
+                websocketpp::frame::opcode::binary, ec);
+  if (ec)
+    NFD_LOG_FACE_WARN("Failed to send Data: " << ec.message());
 }
 
 void
@@ -95,9 +91,9 @@
 
   m_closed = true;
   scheduler::cancel(m_pingEventId);
-  websocketpp::lib::error_code ecode;
-  m_server.close(m_handle, websocketpp::close::status::normal, "closed by nfd", ecode);
-
+  websocketpp::lib::error_code ec;
+  m_server.close(m_handle, websocketpp::close::status::normal, "closed by nfd", ec);
+  // ignore error on close
   fail("Face closed");
 }
 
