mgmt+face: move protocol-specific face creation checks into protocol factories

Also brought implementation of faces/create in line with design

refs #3731

Change-Id: I4f48079136b42c7fdbd4fdfba37116d2565f9dc1
diff --git a/tests/other/face-benchmark.cpp b/tests/other/face-benchmark.cpp
index 1dc6c37..c468bf1 100644
--- a/tests/other/face-benchmark.cpp
+++ b/tests/other/face-benchmark.cpp
@@ -54,11 +54,11 @@
     parseConfig(configFileName);
 
     m_tcpChannel.listen(bind(&FaceBenchmark::onLeftFaceCreated, this, _1),
-                        bind(&FaceBenchmark::onFaceCreationFailed, _1));
+                        bind(&FaceBenchmark::onFaceCreationFailed, _1, _2));
     std::clog << "Listening on " << m_tcpChannel.getUri() << std::endl;
 
     m_udpChannel.listen(bind(&FaceBenchmark::onLeftFaceCreated, this, _1),
-                        bind(&FaceBenchmark::onFaceCreationFailed, _1));
+                        bind(&FaceBenchmark::onFaceCreationFailed, _1, _2));
     std::clog << "Listening on " << m_udpChannel.getUri() << std::endl;
   }
 
@@ -129,13 +129,13 @@
     if (uriR.getScheme() == "tcp4") {
       m_tcpChannel.connect(tcp::Endpoint(addr, port),
                            bind(&FaceBenchmark::onRightFaceCreated, this, faceL, _1),
-                           bind(&FaceBenchmark::onFaceCreationFailed, _1));
+                           bind(&FaceBenchmark::onFaceCreationFailed, _1, _2));
     }
     else if (uriR.getScheme() == "udp4") {
       m_udpChannel.connect(udp::Endpoint(addr, port),
                            ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
                            bind(&FaceBenchmark::onRightFaceCreated, this, faceL, _1),
-                           bind(&FaceBenchmark::onFaceCreationFailed, _1));
+                           bind(&FaceBenchmark::onFaceCreationFailed, _1, _2));
     }
   }
 
@@ -158,9 +158,9 @@
   }
 
   static void
-  onFaceCreationFailed(const std::string& reason)
+  onFaceCreationFailed(uint32_t status, const std::string& reason)
   {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Failed to create face: " + reason));
+    BOOST_THROW_EXCEPTION(std::runtime_error("Failed to create face: " + to_string(status) + ": " + reason));
   }
 
 private: