diff options
-rw-r--r-- | src/rabbit_connection_sup.erl | 8 | ||||
-rw-r--r-- | src/rabbit_networking.erl | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_connection_sup.erl b/src/rabbit_connection_sup.erl index 3c344ba0..b2aba2ee 100644 --- a/src/rabbit_connection_sup.erl +++ b/src/rabbit_connection_sup.erl @@ -29,7 +29,7 @@ -ifdef(use_specs). -spec(start_link/0 :: () -> {'ok', pid(), pid()}). --spec(reader/1 :: (pid()) -> pid() | noproc). +-spec(reader/1 :: (pid()) -> pid()). -endif. @@ -57,11 +57,7 @@ start_link() -> {ok, SupPid, ReaderPid}. reader(Pid) -> - try - hd(supervisor2:find_child(Pid, reader)) - catch exit:{noproc, _} -> - noproc - end. + hd(supervisor2:find_child(Pid, reader)). %%-------------------------------------------------------------------------- diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index 146d04cd..045ab89a 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -310,7 +310,11 @@ connections_local() -> [Reader || {_, ConnSup, supervisor, _} <- supervisor:which_children(rabbit_tcp_client_sup), - Reader <- [rabbit_connection_sup:reader(ConnSup)], + Reader <- [try + rabbit_connection_sup:reader(ConnSup) + catch exit:{noproc, _} -> + noproc + end], Reader =/= noproc]. connection_info_keys() -> rabbit_reader:info_keys(). |