mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-01 17:53:00 +01:00
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:
parent
2d38d48a55
commit
5a8f1ca528
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user