Skip to content

Commit

Permalink
Fix spurious warnings on database save.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaeza committed Nov 1, 2015
1 parent 5d91fb6 commit 2903f6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ local function save_db()
local f, e = io.open(DB_FILENAME, "wt")
db.timestamp = os.time()
if f then
local ok = f:write(xban.serialize(db))
WARNING("Unable to save database: %s", "Write failed")
local ok, err = f:write(xban.serialize(db))
if not ok then
WARNING("Unable to save database: %s", err)
end
else
WARNING("Unable to save database: %s", e)
end
if f then f:close() end
return
Expand Down

0 comments on commit 2903f6a

Please sign in to comment.