From d085fff14bc06581e36977f528aa51dd805b5473 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 3 Apr 2019 11:33:07 +0200 Subject: [PATCH] Make http_api command execution exception catcher log also command and args --- src/mod_http_api.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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} -> -- 2.40.0