From 54de66e7b0e41310db82d2c26f221ad4d1321669 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 7 Jan 2025 19:24:05 +0000 Subject: mod_admin_shell: user:create(): Reject promise with error message on failure --- plugins/mod_admin_shell.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') 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); -- cgit v1.2.3