From e8c0242d19bffb67b030928ff7e8af3933af5231 Mon Sep 17 00:00:00 2001 From: Spivee Date: Mon, 1 May 2023 14:37:53 +1000 Subject: [PATCH] Fix handle_down error message (#2) * Fix handle_down error message It was printing a tuple with `~s`, and also tried to pretty print a fat call stack more than a hundred columns into the first line, which put together made for some confusing exception-during-error-handling messages in the erlang console. * Switch to unicode formatting in handle_down --- bindings/erlang/src/vanillae_man.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bindings/erlang/src/vanillae_man.erl b/bindings/erlang/src/vanillae_man.erl index 53a6e68..eea3516 100644 --- a/bindings/erlang/src/vanillae_man.erl +++ b/bindings/erlang/src/vanillae_man.erl @@ -189,9 +189,11 @@ handle_down(PID, Mon, Info, State = #s{fetchers = Fetchers}) -> {value, #fetcher{time = Time, node = Node, from = From, req = R}, Remaining} -> TS = calendar:system_time_to_rfc3339(Time, [{unit, nanosecond}]), Format = - "ERROR ~s: Fetcher process ~p making request to ~p exited with ~p~n" - "Request contents:~n~n" - "~s", + "ERROR ~ts: Fetcher process ~130tp exited while making request to ~130tp~n" + "Exit reason:~n" + "~tp~n" + "Request contents:~n" + "~tp~n~n", Formatted = io_lib:format(Format, [TS, PID, Node, Info, R]), Message = unicode:characters_to_list(Formatted), ok = gen_server:reply(From, {error, Message}),