aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/main.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-30 22:15:40 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-30 22:15:40 +0100
commit459ec6040e95444a19de9cfbf34b5b9c94e09060 (patch)
tree37b942eb3a02bf21ff35bccb9364378e6b65505e /src/daemon/main.cpp
parentMerge pull request #870 (diff)
downloadmonero-459ec6040e95444a19de9cfbf34b5b9c94e09060.tar.xz
daemon: print exception errors when failing to parse config file
When an exception happens while reading the config file, we need to print the error, as the logging system isn't initialized yet, so the generic catch will not print anything.
Diffstat (limited to '')
-rw-r--r--src/daemon/main.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index 2e2f8936c..638fae20e 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -180,7 +180,16 @@ int main(int argc, char const * argv[])
boost::system::error_code ec;
if (bf::exists(config_path, ec))
{
- po::store(po::parse_config_file<char>(config_path.string<std::string>().c_str(), core_settings), vm);
+ try
+ {
+ po::store(po::parse_config_file<char>(config_path.string<std::string>().c_str(), core_settings), vm);
+ }
+ catch (const std::exception &e)
+ {
+ // log system isn't initialized yet
+ std::cerr << "Error parsing config file: " << e.what() << std::endl;
+ throw;
+ }
}
po::notify(vm);