From 545538bd9bcddece6eda6f5cab915de7d40ca7a1 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Tue, 21 Jul 2020 13:51:14 +0300 Subject: [PATCH] Attempt to catch possible windows exception --- components/common/cpp/src/configuration.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp index 327bfd03b..607d171cf 100644 --- a/components/common/cpp/src/configuration.cpp +++ b/components/common/cpp/src/configuration.cpp @@ -867,10 +867,16 @@ Configurable *ftl::config::configure(int argc, char **argv, const std::string &r config_restore = std::move(ftl::loadJSON(std::string(FTL_LOCAL_CONFIG_ROOT "/")+cfg_root_str+std::string("_session.json"))); - Configurable *rootcfg = create<Configurable>(config); - if (root_str.size() > 0) { - LOG(INFO) << "Setting root to " << root_str; - rootcfg = create<Configurable>(rootcfg, root_str); + Configurable *rootcfg = nullptr; + + try { + rootcfg = create<Configurable>(config); + if (root_str.size() > 0) { + LOG(INFO) << "Setting root to " << root_str; + rootcfg = create<Configurable>(rootcfg, root_str); + } + } catch (const std::exception &e) { + LOG(FATAL) << "Exception setting root: " << e.what(); } //root_config = rootcfg->getConfig(); -- GitLab