aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver
diff options
context:
space:
mode:
authorzousar <[email protected]>2025-05-07 12:17:57 -0600
committerzousar <[email protected]>2025-05-07 12:17:57 -0600
commitc00afaefd9dc359a0a20c64a50c2d0553e44a73b (patch)
treefc80e1cf639ad6ec0bbee126654b23aa63ae1396 /src/zenserver
parent5.6.7 (diff)
downloadzen-c00afaefd9dc359a0a20c64a50c2d0553e44a73b.tar.xz
zen-c00afaefd9dc359a0a20c64a50c2d0553e44a73b.zip
Change plugin config parsing to warn instead of throw
Diffstat (limited to 'src/zenserver')
-rw-r--r--src/zenserver/config.cpp16
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;