tools: fix bug that nfdc register does not terminate if FaceUri canonization fails

refs #2397

Change-Id: I8c1dce00cfbf4926ead7c4794d02158e43008000
diff --git a/tools/nfdc.cpp b/tools/nfdc.cpp
index dcb228c..6c53b60 100644
--- a/tools/nfdc.cpp
+++ b/tools/nfdc.cpp
@@ -415,13 +415,13 @@
 void
 Nfdc::onCanonizeFailure(const std::string& reason)
 {
-  std::cerr << reason << std::endl;
+  throw Error(reason);
 }
 
 void
 Nfdc::onObtainFaceIdFailure(const std::string& message)
 {
-  std::cerr << "Obtain faceId failure: " << message << std::endl;
+  throw Error(message);
 }
 
 void