Skip to content

Commit affdadc

Browse files
committed
inet_tcp_proxy: Log proxy crash to stderr and error_logger
Also, give a chance to those log messages to reach their destination by sleeping for one second before stopping the VM. [#146911969]
1 parent f879352 commit affdadc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/inet_tcp_proxy.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ error_handler(Thunk) ->
6868
%% over; die quietly.
6969
ok;
7070
_:X ->
71-
io:format(user, "TCP proxy died with ~p~n At ~p~n",
71+
error_logger:error_msg(
72+
"TCP proxy died with ~p~n At ~p~n",
73+
[X, erlang:get_stacktrace()]),
74+
io:format(standard_error,
75+
"TCP proxy died with ~p~n At ~p~n",
7276
[X, erlang:get_stacktrace()]),
77+
timer:sleep(1000),
7378
erlang:halt(1)
7479
end
7580
end.

0 commit comments

Comments
 (0)