From 33c20a1220a3ca8a0c7ea35702a914d2c10a30c5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 15 May 2015 15:25:59 +0200 Subject: mod_storage_xep0227: Return error from io.open if unable to open file for writing --- plugins/mod_storage_xep0227.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua index 22575fe3..61ef7d6d 100644 --- a/plugins/mod_storage_xep0227.lua +++ b/plugins/mod_storage_xep0227.lua @@ -23,8 +23,8 @@ end 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); -- cgit v1.2.3