aboutsummaryrefslogtreecommitdiff
path: root/zenserver/config.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-22 21:21:27 +0200
committerPer Larsson <[email protected]>2021-09-22 21:21:27 +0200
commit7ba8fc0fdb85669fa8103b0289c999b15643348b (patch)
treea4baf212f0e24eae22d14600391c9603ee652d80 /zenserver/config.cpp
parentMade upstream endpoints more resilient to failures by checking health/reconne... (diff)
parentAdded map file generation option (commented out by default) (diff)
downloadzen-7ba8fc0fdb85669fa8103b0289c999b15643348b.tar.xz
zen-7ba8fc0fdb85669fa8103b0289c999b15643348b.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenserver/config.cpp')
-rw-r--r--zenserver/config.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/zenserver/config.cpp b/zenserver/config.cpp
index 1a24bba0d..c21638258 100644
--- a/zenserver/config.cpp
+++ b/zenserver/config.cpp
@@ -277,22 +277,24 @@ ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& Serv
try
{
- sol::load_result config = lua.load(std::string_view((const char*)LuaScript.Data(), LuaScript.Size()), "zencfg");
+ sol::load_result config = lua.load(std::string_view((const char*)LuaScript.Data(), LuaScript.Size()), "zen_cfg");
- if (config.status() != sol::load_status::ok)
+ if (!config.valid())
{
+ sol::error err = config;
+
std::string ErrorString = sol::to_string(config.status());
- throw std::runtime_error("lua '{}' error"_format(ErrorString));
+ throw std::runtime_error("{} error: {}"_format(ErrorString, err.what()));
}
config();
}
catch (std::exception& e)
{
- ZEN_ERROR("config script failure: {}", e.what());
+ ZEN_ERROR("config failure: {}", e.what());
- throw std::runtime_error("fatal zen global config script ({}) failure: {}"_format(ConfigScript, e.what()).c_str());
+ throw std::runtime_error("failed to run global config script ('{}'): {}"_format(ConfigScript, e.what()).c_str());
}
ServiceConfig.MeshEnabled = lua["mesh"]["enable"].get_or(ServiceConfig.MeshEnabled);