25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Make http_api command execution exception catcher log also command and args

This commit is contained in:
Paweł Chmielowski 2019-04-03 11:33:07 +02:00
parent cbac8a604a
commit d085fff14b

View File

@ -306,7 +306,10 @@ handle(Call, Auth, Args, Version) when is_atom(Call), is_list(Args) ->
throw:Msg when is_list(Msg); is_binary(Msg) ->
{400, iolist_to_binary(Msg)};
?EX_RULE(Class, Error, Stack) ->
?ERROR_MSG("REST API Error: ~p:~p ~p", [Class, Error, ?EX_STACK(Stack)]),
?ERROR_MSG("REST API Error: "
"~s(~p) -> ~p:~p ~p",
[Call, hide_sensitive_args(Args),
Class, Error, ?EX_STACK(Stack)]),
{500, <<"internal_error">>}
end;
{error, Msg} ->