Changeset

1745:851cb0b3d584

mod_profile: Return error on storage error, don't attempt to migrate from old storage
author Kim Alvefur <zash@zash.se>
date Mon, 18 May 2015 02:58:17 +0200
parents 1744:fbef84033fae
children 1746:5734a6199938
files mod_profile/mod_profile.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_profile/mod_profile.lua	Mon May 18 02:56:41 2015 +0200
+++ b/mod_profile/mod_profile.lua	Mon May 18 02:58:17 2015 +0200
@@ -87,8 +87,12 @@
 	local username = origin.username;
 	local to = stanza.attr.to;
 	if to then username = jid_split(to); end
-	local data = storage:get(username);
+	local data, err = storage:get(username);
 	if not data then
+		if err then
+			origin.send(st.error_reply(stanza, "cancel", "internal-server-error", err));
+			return true;
+		end
 		data = legacy_storage:get(username);
 		data = data and st.deserialize(data);
 		if data then