# HG changeset patch # User Kim Alvefur # Date 1431696359 -7200 # Node ID 0103dc8fa179f5ac12d8fa9c31a2d533081c6964 # Parent ccdd0b6151064ee8ab19e0e119c3f224fd02cf71 mod_storage_xep0227: Return error from io.open if unable to open file for writing diff -r ccdd0b615106 -r 0103dc8fa179 plugins/mod_storage_xep0227.lua --- a/plugins/mod_storage_xep0227.lua Fri May 15 15:25:37 2015 +0200 +++ b/plugins/mod_storage_xep0227.lua Fri May 15 15:25:59 2015 +0200 @@ -23,8 +23,8 @@ local function setXml(user, host, xml) local jid = user.."@"..host; local path = paths.join(prosody.paths.data, jid..".xml"); - local f = io_open(path, "w"); - if not f then return; end + local f, err = io_open(path, "w"); + if not f then return f, err; end if xml then local s = tostring(xml); f:write(s);