aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2025-01-07 19:24:05 +0000
committerMatthew Wild <mwild1@gmail.com>2025-01-07 19:24:05 +0000
commit54de66e7b0e41310db82d2c26f221ad4d1321669 (patch)
treefc5b98d10419ec4b91a3941716d5eb41eb003288 /plugins
parentf40e9978797b9bb7a7567264c6ac48c40ea06b10 (diff)
downloadprosody-54de66e7b0e41310db82d2c26f221ad4d1321669.tar.gz
prosody-54de66e7b0e41310db82d2c26f221ad4d1321669.zip
mod_admin_shell: user:create(): Reject promise with error message on failure
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_shell.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index cb84af50..5c5b0b48 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -1728,7 +1728,7 @@ function def_env.user:create(jid, password, role)
return promise.resolve(password or self.session.request_input("password")):next(function (password_)
local ok, err = um.create_user_with_role(username, password_, host, role);
if not ok then
- return nil, "Could not create user: "..err;
+ return promise.reject("Could not create user: "..err);
end
return ("Created %s with role '%s'"):format(jid, role);
end);