Software /
code /
prosody
Changeset
13597:62aca6adcfd3
mod_admin_shell: user:create(): Reject promise with error message on failure
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 07 Jan 2025 19:24:05 +0000 |
parents | 13596:85e8cc6870ae |
children | 13598:2cd43975a15c |
files | plugins/mod_admin_shell.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua Tue Jan 07 19:23:23 2025 +0000 +++ b/plugins/mod_admin_shell.lua Tue Jan 07 19:24:05 2025 +0000 @@ -1728,7 +1728,7 @@ 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);