From cdec32da63b2f3aa4ecad37f2dfcedddc0c920cd Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 14 Dec 2023 19:56:04 +0000 Subject: [PATCH] config: do not require config file fixes #109 --- src/config/ConfigManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index c370c17..51ab073 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -12,8 +12,8 @@ CConfigManager::CConfigManager() { ifs.open(configPath); if (!ifs.good()) { - Debug::log(CRIT, "Config file `%s` couldn't be opened.", configPath.c_str()); - exit(1); + Debug::log(WARN, "Config file `%s` couldn't be opened. Running without a config!", configPath.c_str()); + return; } std::string line = ""; @@ -42,8 +42,7 @@ CConfigManager::CConfigManager() { } if (!parseError.empty()) { - Debug::log(CRIT, "Exiting because of config parse errors!\n%s", parseError.c_str()); - exit(1); + Debug::log(WARN, "Config parse error: \n%s\n\nRunning and ignoring errors...\n", parseError.c_str()); return; } }