diff options
| author | Zousar Shaker <[email protected]> | 2025-05-08 16:01:40 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-05-08 16:01:40 +0100 |
| commit | 4207b2d5d3eebee504bc72195aa588b1ac17e3fe (patch) | |
| tree | b7f5c985bc14aa93f169b1bc9ddd918c03e1ba18 /src/zenserver/config.cpp | |
| parent | 5.6.7 (diff) | |
| parent | Changelog (diff) | |
| download | zen-4207b2d5d3eebee504bc72195aa588b1ac17e3fe.tar.xz zen-4207b2d5d3eebee504bc72195aa588b1ac17e3fe.zip | |
Merge pull request #386 from ue-foundation/zs/plugin-config-hardening
Zs/plugin config hardening
Diffstat (limited to 'src/zenserver/config.cpp')
| -rw-r--r-- | src/zenserver/config.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index e81e8eb54..7b8e38e80 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -527,15 +527,15 @@ ParsePluginsConfigFile(const std::filesystem::path& Path, ZenServerOptions& Serv json11::Json PluginsInfo = json11::Json::parse(JsonText, JsonError); if (!JsonError.empty()) { - throw std::runtime_error(fmt::format("failed parsing json file '{}'. Reason: '{}'", Path, JsonError)); + ZEN_WARN("failed parsing plugins config file '{}'. Reason: '{}'", Path, JsonError); + return; } for (const json11::Json& PluginInfo : PluginsInfo.array_items()) { if (!PluginInfo.is_object()) { - throw std::runtime_error(fmt::format("the json file '{}' does not contain a valid plugin definition, object expected, got '{}'", - Path, - PluginInfo.dump())); + ZEN_WARN("the json file '{}' does not contain a valid plugin definition, object expected, got '{}'", Path, PluginInfo.dump()); + continue; } HttpServerPluginConfig Config = {}; @@ -546,10 +546,10 @@ ParsePluginsConfigFile(const std::filesystem::path& Path, ZenServerOptions& Serv { if (!Items.second.is_string()) { - throw std::runtime_error( - fmt::format("the json file '{}' does not contain a valid plugins definition, string expected, got '{}'", - Path, - Items.second.dump())); + ZEN_WARN("the json file '{}' does not contain a valid plugins definition, string expected, got '{}'", + Path, + Items.second.dump()); + continue; } const std::string& Name = Items.first; |