mirror of
https://github.com/minetest-mods/xban2.git
synced 2025-03-21 23:22:21 +00:00
Fix spurious warnings on database save.
This commit is contained in:
parent
5d91fb66ad
commit
2903f6ae5a
1 changed files with 6 additions and 2 deletions
8
init.lua
8
init.lua
|
@ -283,8 +283,12 @@ local function save_db()
|
||||||
local f, e = io.open(DB_FILENAME, "wt")
|
local f, e = io.open(DB_FILENAME, "wt")
|
||||||
db.timestamp = os.time()
|
db.timestamp = os.time()
|
||||||
if f then
|
if f then
|
||||||
local ok = f:write(xban.serialize(db))
|
local ok, err = f:write(xban.serialize(db))
|
||||||
WARNING("Unable to save database: %s", "Write failed")
|
if not ok then
|
||||||
|
WARNING("Unable to save database: %s", err)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
WARNING("Unable to save database: %s", e)
|
||||||
end
|
end
|
||||||
if f then f:close() end
|
if f then f:close() end
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue