From f2319de49db787ad2502bd3a9b27a7b4a30ed897 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 31 Aug 2014 16:10:45 +0200 Subject: [PATCH] + do not abort if user.cfg or system.cfg is empty --- src/App/Application.cpp | 4 ++-- src/Base/Parameter.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 5e577619d..7d4746fff 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1372,7 +1372,7 @@ void Application::LoadParameters(void) catch (const Base::Exception& e) { // try to proceed with an empty XML document Base::Console().Error("%s in file %s.\n" - "Continue with an empty configuration.", + "Continue with an empty configuration.\n", e.what(), mConfig["SystemParameter"].c_str()); _pcSysParamMngr->CreateDocument(); } @@ -1391,7 +1391,7 @@ void Application::LoadParameters(void) catch (const Base::Exception& e) { // try to proceed with an empty XML document Base::Console().Error("%s in file %s.\n" - "Continue with an empty configuration.", + "Continue with an empty configuration.\n", e.what(), mConfig["UserParameter"].c_str()); _pcUserParamMngr->CreateDocument(); } diff --git a/src/Base/Parameter.cpp b/src/Base/Parameter.cpp index 21ddc1fc9..7eaa80de3 100644 --- a/src/Base/Parameter.cpp +++ b/src/Base/Parameter.cpp @@ -1090,9 +1090,13 @@ int ParameterManager::LoadDocument(const char* sFileName) #endif return LoadDocument(inputSource); } + catch (const Base::Exception& e) { + std::cerr << e.what() << std::endl; + throw; + } catch (...) { std::cerr << "An error occurred during parsing\n " << std::endl; - return 0; + throw; } }