Skip to content

Commit fa9a7e7

Browse files
author
Simon MacMullen
committed
Move the try / catch into rabbit_networking.
1 parent 97ea55f commit fa9a7e7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/rabbit_connection_sup.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
-ifdef(use_specs).
3030

3131
-spec(start_link/0 :: () -> {'ok', pid(), pid()}).
32-
-spec(reader/1 :: (pid()) -> pid() | noproc).
32+
-spec(reader/1 :: (pid()) -> pid()).
3333

3434
-endif.
3535

@@ -57,11 +57,7 @@ start_link() ->
5757
{ok, SupPid, ReaderPid}.
5858

5959
reader(Pid) ->
60-
try
61-
hd(supervisor2:find_child(Pid, reader))
62-
catch exit:{noproc, _} ->
63-
noproc
64-
end.
60+
hd(supervisor2:find_child(Pid, reader)).
6561

6662
%%--------------------------------------------------------------------------
6763

src/rabbit_networking.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ connections_local() ->
310310
[Reader ||
311311
{_, ConnSup, supervisor, _}
312312
<- supervisor:which_children(rabbit_tcp_client_sup),
313-
Reader <- [rabbit_connection_sup:reader(ConnSup)],
313+
Reader <- [try
314+
rabbit_connection_sup:reader(ConnSup)
315+
catch exit:{noproc, _} ->
316+
noproc
317+
end],
314318
Reader =/= noproc].
315319

316320
connection_info_keys() -> rabbit_reader:info_keys().

0 commit comments

Comments
 (0)