aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_conns_sup.erl
diff options
context:
space:
mode:
authorJames Fish <[email protected]>2013-08-29 17:45:50 +0100
committerJames Fish <[email protected]>2013-08-29 17:47:45 +0100
commitef10414e67761f3e45500d1d0190dc6dfe60c4eb (patch)
tree2f24bf75dad197142de9b03ec5de888195898b52 /src/ranch_conns_sup.erl
parent767109b1c371448baf8ad01d77b71f4ea8c3f858 (diff)
downloadranch-ef10414e67761f3e45500d1d0190dc6dfe60c4eb.tar.gz
ranch-ef10414e67761f3e45500d1d0190dc6dfe60c4eb.tar.bz2
ranch-ef10414e67761f3e45500d1d0190dc6dfe60c4eb.zip
Include protocol module in error report when connection fails
Diffstat (limited to 'src/ranch_conns_sup.erl')
-rw-r--r--src/ranch_conns_sup.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ranch_conns_sup.erl b/src/ranch_conns_sup.erl
index c6b11ec..245a5e0 100644
--- a/src/ranch_conns_sup.erl
+++ b/src/ranch_conns_sup.erl
@@ -149,12 +149,12 @@ loop(State=#state{parent=Parent, ref=Ref, conn_type=ConnType,
{'EXIT', Parent, Reason} ->
exit(Reason);
{'EXIT', Pid, Reason} when Sleepers =:= [] ->
- report_error(Ref, Pid, Reason),
+ report_error(Ref, Protocol, Pid, Reason),
erase(Pid),
loop(State, CurConns - 1, NbChildren - 1, Sleepers);
%% Resume a sleeping acceptor if needed.
{'EXIT', Pid, Reason} ->
- report_error(Ref, Pid, Reason),
+ report_error(Ref, Protocol, Pid, Reason),
erase(Pid),
[To|Sleepers2] = Sleepers,
To ! self(),
@@ -198,14 +198,14 @@ system_code_change(Misc, _, _, _) ->
%% We use ~999999p here instead of ~w because the latter doesn't
%% support printable strings.
-report_error(_, _, normal) ->
+report_error(_, _, _, normal) ->
ok;
-report_error(_, _, shutdown) ->
+report_error(_, _, _, shutdown) ->
ok;
-report_error(_, _, {shutdown, _}) ->
+report_error(_, _, _, {shutdown, _}) ->
ok;
-report_error(Ref, Pid, Reason) ->
+report_error(Ref, Protocol, Pid, Reason) ->
error_logger:error_msg(
- "Ranch listener ~p had connection process ~p "
- "exit with reason: ~999999p~n",
- [Ref, Pid, Reason]).
+ "Ranch listener ~p had connection process started with "
+ "~p:start_link/4 at ~p exit with reason: ~999999p~n",
+ [Ref, Protocol, Pid, Reason]).