diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-12-27 11:16:52 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-12-27 11:16:52 +0000 |
commit | cd69f807e6546b115c92728ef38ced6a1978577f (patch) | |
tree | 19dd0991c86990409ad86edba2db41127191c2d9 | |
parent | 5fb737c8ab423e1eede97c7879685b8d4e47c4a9 (diff) | |
download | rabbitmq-server-cd69f807e6546b115c92728ef38ced6a1978577f.tar.gz |
simplification: use alternative 'try' form
-rw-r--r-- | src/rabbit_channel.erl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 19104bcb..ca2782c7 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, |