Changeset

6700:0103dc8fa179

mod_storage_xep0227: Return error from io.open if unable to open file for writing
author Kim Alvefur <zash@zash.se>
date Fri, 15 May 2015 15:25:59 +0200
parents 6699:ccdd0b615106
children 6701:88a25c364a14
files plugins/mod_storage_xep0227.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);