client command line tool: add exception catch for configuration file loading
refs: #4961
Change-Id: I5ea2a6c9dd36b5158b0954ee8cce1b97011ebc01
diff --git a/tools/ndncert-client.cpp b/tools/ndncert-client.cpp
index 4b926c7..f6460fd 100644
--- a/tools/ndncert-client.cpp
+++ b/tools/ndncert-client.cpp
@@ -332,7 +332,13 @@
std::cerr << description << std::endl;
return 0;
}
- client.getClientConf().load(configFilePath);
+ try {
+ client.getClientConf().load(configFilePath);
+ }
+ catch (const std::exception& e) {
+ std::cerr << "Cannot load the configuration file: " << e.what() << std::endl;
+ return 1;
+ }
startApplication();
face.processEvents();
return 0;