Replace nfd::getExtendedErrorMessage with boost::diagnostic_information
Refs: #4834
Change-Id: I7fc00960d7e5a97748b2277c525a19775810377f
diff --git a/tools/ndn-autoconfig-server/main.cpp b/tools/ndn-autoconfig-server/main.cpp
index 1077a8d..c281148 100644
--- a/tools/ndn-autoconfig-server/main.cpp
+++ b/tools/ndn-autoconfig-server/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -24,12 +24,13 @@
*/
#include "program.hpp"
-#include "core/extended-error-message.hpp"
#include "core/version.hpp"
#include <iostream>
#include <unistd.h>
+#include <boost/exception/diagnostic_information.hpp>
+
namespace ndn {
namespace tools {
namespace autoconfig_server {
@@ -42,8 +43,8 @@
<< "Options:\n"
<< " -h - print usage and exit\n"
<< " -V - print version number and exit\n"
- << " -p prefix - a local prefix of the HUB\n"
- << " hub-face - a FaceUri to reach the HUB\n";
+ << " -p prefix - a local prefix of the hub\n"
+ << " hub-face - a FaceUri to reach the hub\n";
}
static int
@@ -75,7 +76,7 @@
}
if (!options.hubFaceUri.parse(argv[::optind])) {
- std::cerr << "ERROR: cannot parse HUB FaceUri" << std::endl;
+ std::cerr << "ERROR: cannot parse hub FaceUri" << std::endl;
return 2;
}
@@ -86,7 +87,7 @@
program.run();
}
catch (const std::exception& e) {
- std::cerr << ::nfd::getExtendedErrorMessage(e) << std::endl;
+ std::cerr << "ERROR: " << boost::diagnostic_information(e);
return 1;
}
return 0;
diff --git a/tools/ndn-autoconfig/main.cpp b/tools/ndn-autoconfig/main.cpp
index a8b2c45..dd7bec6 100644
--- a/tools/ndn-autoconfig/main.cpp
+++ b/tools/ndn-autoconfig/main.cpp
@@ -24,15 +24,17 @@
*/
#include "procedure.hpp"
-#include "core/extended-error-message.hpp"
#include "core/scheduler.hpp"
#include "core/version.hpp"
#include <signal.h>
#include <string.h>
+
+#include <boost/exception/diagnostic_information.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
+
#include <ndn-cxx/net/network-monitor.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/util/time.hpp>
@@ -48,9 +50,9 @@
namespace tools {
namespace autoconfig {
-static const time::nanoseconds DAEMON_INITIAL_DELAY = time::milliseconds(100);
-static const time::nanoseconds DAEMON_UNCONDITIONAL_INTERVAL = time::hours(1);
-static const time::nanoseconds NETMON_DAMPEN_PERIOD = time::seconds(5);
+static const time::nanoseconds DAEMON_INITIAL_DELAY = 100_ms;
+static const time::nanoseconds DAEMON_UNCONDITIONAL_INTERVAL = 1_h;
+static const time::nanoseconds NETMON_DAMPEN_PERIOD = 5_s;
namespace po = boost::program_options;
@@ -181,7 +183,7 @@
}
}
catch (const std::exception& e) {
- std::cerr << ::nfd::getExtendedErrorMessage(e) << std::endl;
+ std::cerr << "ERROR: " << boost::diagnostic_information(e);
return 1;
}
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
index cd3f093..fed9cfb 100644
--- a/tools/nfd-autoreg.cpp
+++ b/tools/nfd-autoreg.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -23,7 +23,6 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "core/extended-error-message.hpp"
#include "core/network.hpp"
#include "core/version.hpp"
@@ -36,6 +35,7 @@
#include <ndn-cxx/net/face-uri.hpp>
#include <ndn-cxx/security/key-chain.hpp>
+#include <boost/exception/diagnostic_information.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
#include <boost/program_options/parsers.hpp>
@@ -277,7 +277,7 @@
startProcessing();
}
catch (const std::exception& e) {
- std::cerr << "ERROR: " << ::nfd::getExtendedErrorMessage(e) << std::endl;
+ std::cerr << "ERROR: " << boost::diagnostic_information(e);
return 1;
}