mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
mod_admin_shell: user:create(): Reject promise with error message on failure
This commit is contained in:
parent
f40e997879
commit
54de66e7b0
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue