Added: mod_register now replies with an error stanza when file write fails

Thu, 09 Oct 2008 02:08:33 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Thu, 09 Oct 2008 02:08:33 +0500
changeset 85
a115b99419ad
parent 84
d0a0bac6815e
child 86
a2085854c72c

Added: mod_register now replies with an error stanza when file write fails

plugins/mod_register.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_register.lua	Thu Oct 09 01:20:43 2008 +0500
+++ b/plugins/mod_register.lua	Thu Oct 09 02:08:33 2008 +0500
@@ -29,7 +29,8 @@
 						if usermanager_create_user(username, password, session.host) then -- password change -- TODO is this the right way?
 							send(session, st.reply(stanza));
 						else
-							-- TODO internal error, unable to write file, file may be locked, etc
+							-- TODO unable to write file, file may be locked, etc, what's the correct error?
+							send(session, st.error_reply(stanza, "wait", "internal-server-error"));
 						end
 					else
 						send(session, st.error_reply(stanza, "modify", "bad-request"));
@@ -70,7 +71,8 @@
 						if usermanager_create_user(username, password, session.host) then
 							send(session, st.reply(stanza)); -- user created!
 						else
-							-- TODO internal error, unable to write file, file may be locked, etc
+							-- TODO unable to write file, file may be locked, etc, what's the correct error?
+							send(session, st.error_reply(stanza, "wait", "internal-server-error"));
 						end
 					end
 				else

mercurial