From: Paweł Chmielowski Date: Wed, 3 Apr 2019 09:33:07 +0000 (+0200) Subject: Make http_api command execution exception catcher log also command and args X-Git-Tag: 19.05~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d085fff14bc06581e36977f528aa51dd805b5473;p=ejabberd Make http_api command execution exception catcher log also command and args --- diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 8cc80982a..5bda709c2 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -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} ->