Display extender error message in ejabberdctl

This for example makes error from register explain what account
can't be registered

For reference https://github.com/processone/ejabberd/discussions/3584
This commit is contained in:
Paweł Chmielowski 2021-04-22 11:56:58 +02:00
parent 2d38d48a55
commit 5a8f1ca528
1 changed files with 2 additions and 2 deletions

View File

@ -394,8 +394,8 @@ format_result({error, ErrorAtom}, _) ->
%% An error should always be allowed to return extended error to help with API.
%% Extended error is of the form:
%% {error, type :: atom(), code :: int(), Desc :: string()}
format_result({error, ErrorAtom, Code, _Msg}, _) ->
{io_lib:format("Error: ~p", [ErrorAtom]), make_status(Code)};
format_result({error, ErrorAtom, Code, Msg}, _) ->
{io_lib:format("Error: ~p: ~s", [ErrorAtom, Msg]), make_status(Code)};
format_result(Atom, {_Name, atom}) ->
io_lib:format("~p", [Atom]);