summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2008-12-27 11:16:52 +0000
committerMatthias Radestock <matthias@lshift.net>2008-12-27 11:16:52 +0000
commit69957f6f24f98fb0ad264599b47ca6c71ebb38b8 (patch)
tree19dd0991c86990409ad86edba2db41127191c2d9 /src
parent4be2257979970f5b697d1e4402ca0bd6bd3ae691 (diff)
downloadrabbitmq-server-git-69957f6f24f98fb0ad264599b47ca6c71ebb38b8.tar.gz
simplification: use alternative 'try' form
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 19104bcb90..ca2782c77d 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -111,16 +111,14 @@ init(ProxyPid, [ReaderPid, WriterPid, Username, VHost]) ->
consumer_mapping = dict:new()}.
handle_message({method, Method, Content}, State) ->
- try
- case handle_method(Method, Content, State) of
- {reply, Reply, NewState} ->
- ok = rabbit_writer:send_command(NewState#ch.writer_pid, Reply),
- NewState;
- {noreply, NewState} ->
- NewState;
- stop ->
- exit(normal)
- end
+ try handle_method(Method, Content, State) of
+ {reply, Reply, NewState} ->
+ ok = rabbit_writer:send_command(NewState#ch.writer_pid, Reply),
+ NewState;
+ {noreply, NewState} ->
+ NewState;
+ stop ->
+ exit(normal)
catch
exit:{amqp, Error, Explanation, none} ->
terminate({amqp, Error, Explanation,