mirror of
https://github.com/MinetestForFun/mysql_auth.git
synced 2025-01-08 00:50:25 +01:00
Add minetest.deserialize error reporting (failed config parsing)
This commit is contained in:
parent
84fff7e863
commit
cd784a5842
5
init.lua
5
init.lua
@ -78,8 +78,11 @@ do
|
|||||||
if not file then
|
if not file then
|
||||||
error(modname .. ' failed to load specified config file at ' .. cfgfile)
|
error(modname .. ' failed to load specified config file at ' .. cfgfile)
|
||||||
end
|
end
|
||||||
local cfg = minetest.deserialize(file:read('*a'))
|
local cfg, msg = minetest.deserialize(file:read('*a'))
|
||||||
file:close()
|
file:close()
|
||||||
|
if not cfg then
|
||||||
|
error(modname .. ' failed to parse specified config file at ' .. cfgfile .. ': ' .. msg)
|
||||||
|
end
|
||||||
get = function (name)
|
get = function (name)
|
||||||
if type(name) ~= 'string' or name == '' then
|
if type(name) ~= 'string' or name == '' then
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user