diff options
| author | Matthias Radestock <matthias@lshift.net> | 2009-02-17 14:11:32 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2009-02-17 14:11:32 +0000 |
| commit | df8eb5505a9822b6d085765b67fd118e9727dae2 (patch) | |
| tree | c27f9653ea685fa8419a6fbfe5d391e3f9ed5e63 | |
| parent | 67dff52a1eb5df683e6a20eefb278cd16fad2fc0 (diff) | |
| download | rabbitmq-server-git-df8eb5505a9822b6d085765b67fd118e9727dae2.tar.gz | |
make it easier to add more exceptions to the 'warning' category in future
| -rw-r--r-- | src/rabbit_reader.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 09148bf0e8..9f642e3540 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -231,12 +231,12 @@ start_connection(Parent, Deb, ClientSock) -> connection_state = pre_init}, handshake, 8)) catch - connection_closed_abruptly -> - rabbit_log:warning("TCP connection ~p from ~s:~p closed abruptly~n", - [self(), PeerAddressS, PeerPort]); - Ex -> - rabbit_log:error("error on TCP connection ~p from ~s:~p~n~p~n", - [self(), PeerAddressS, PeerPort, Ex]) + Ex -> (if Ex == connection_closed_abruptly -> + fun rabbit_log:warning/2; + true -> + fun rabbit_log:error/2 + end)("exception on TCP connection ~p from ~s:~p~n~p~n", + [self(), PeerAddressS, PeerPort, Ex]) after rabbit_log:info("closing TCP connection ~p from ~s:~p~n", [self(), PeerAddressS, PeerPort]), |
