1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-06 03:50:15 +02: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) -> throw:Msg when is_list(Msg); is_binary(Msg) ->
{400, iolist_to_binary(Msg)}; {400, iolist_to_binary(Msg)};
?EX_RULE(Class, Error, Stack) -> ?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">>} {500, <<"internal_error">>}
end; end;
{error, Msg} -> {error, Msg} ->