# HG changeset patch # User Kim Alvefur # Date 1523304349 -7200 # Node ID 6d71845bf56f66df8008e81a1fa05ba42b2b0ef8 # Parent a071c203a1a00a8702986e3e4738de97f6965554 mod_register_ibr: Return a textual error to the user for problems with parsing form data diff -r a071c203a1a0 -r 6d71845bf56f plugins/mod_register_ibr.lua --- a/plugins/mod_register_ibr.lua Sat Apr 07 02:57:05 2018 +0200 +++ b/plugins/mod_register_ibr.lua Mon Apr 09 22:05:49 2018 +0200 @@ -140,10 +140,12 @@ local data, errors = parse_response(query); if errors then log("debug", "Error parsing registration form:"); + local textual_errors = {}; for field, err in pairs(errors) do log("debug", "Field %q: %s", field, err); + table.insert(textual_errors, ("%s: %s"):format(field:gsub("^%a", string.upper), err)); end - session.send(st.error_reply(stanza, "modify", "not-acceptable")); + session.send(st.error_reply(stanza, "modify", "not-acceptable", table.concat(textual_errors, "\n"))); return true; end