]> granicus.if.org Git - ejabberd/commitdiff
Make http_api command execution exception catcher log also command and args
authorPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 3 Apr 2019 09:33:07 +0000 (11:33 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 3 Apr 2019 09:33:07 +0000 (11:33 +0200)
src/mod_http_api.erl

index 8cc80982a0a86427e6beeb354d2362673e992e89..5bda709c25b120a95a08c1d4f9a4f2e0ec6ee5e9 100644 (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} ->