Browse Source

Add an error report when a connection process fails to start

Becoming closer to a standard supervisor everyday.
Loïc Hoguin 11 years ago
parent
commit
366cb0a6df
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/ranch_conns_sup.erl

+ 5 - 1
src/ranch_conns_sup.erl

@@ -128,8 +128,12 @@ loop(State=#state{parent=Parent, ref=Ref, conn_type=ConnType,
 							loop(State, CurConns2, NbChildren + 1,
 								[To|Sleepers])
 					end;
-				_ ->
+				Ret ->
 					To ! self(),
+					error_logger:error_msg(
+						"Ranch listener ~p connection process start failure; "
+						"~p:start_link/4 returned: ~999999p~n",
+						[Ref, Protocol, Ret]),
 					Transport:close(Socket),
 					loop(State, CurConns, NbChildren, Sleepers)
 			end;