diff options
| author | Michael Klishin <michael@rabbitmq.com> | 2013-11-29 12:51:46 +0400 |
|---|---|---|
| committer | Michael Klishin <michael@rabbitmq.com> | 2013-11-29 12:51:46 +0400 |
| commit | 6ec91e29092944196159c0f64d4acfa70e2abec1 (patch) | |
| tree | 2a4fa5729e589bfe8d9a5af38622c3569fbf5522 | |
| parent | 193e12b86a8ea4d8903371a92649a1437b2fac12 (diff) | |
| download | rabbitmq-server-git-6ec91e29092944196159c0f64d4acfa70e2abec1.tar.gz | |
Narrow down try .. catch here
| -rw-r--r-- | src/rabbit_reader.erl | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 023d0da9f7..8caae3b84f 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -674,28 +674,28 @@ handle_frame(Type, Channel, Payload, State) -> process_frame(Frame, Channel, State) -> ChKey = {channel, Channel}, - try - {ChPid, AState} = case get(ChKey) of - undefined -> create_channel(Channel, State); - Other -> Other - end, - case rabbit_command_assembler:process(Frame, AState) of - {ok, NewAState} -> - put(ChKey, {ChPid, NewAState}), - post_process_frame(Frame, ChPid, State); - {ok, Method, NewAState} -> - rabbit_channel:do(ChPid, Method), - put(ChKey, {ChPid, NewAState}), - post_process_frame(Frame, ChPid, State); - {ok, Method, Content, NewAState} -> - rabbit_channel:do_flow(ChPid, Method, Content), - put(ChKey, {ChPid, NewAState}), - post_process_frame(Frame, ChPid, control_throttle(State)); - {error, Reason} -> - handle_exception(State, Channel, Reason) - end - catch exit:Error -> - handle_exception(State, Channel, Error) + {ChPid, AState} = case get(ChKey) of + undefined -> try + create_channel(Channel, State) + catch exit:Error -> + handle_exception(State, Channel, Error) + end; + Other -> Other + end, + case rabbit_command_assembler:process(Frame, AState) of + {ok, NewAState} -> + put(ChKey, {ChPid, NewAState}), + post_process_frame(Frame, ChPid, State); + {ok, Method, NewAState} -> + rabbit_channel:do(ChPid, Method), + put(ChKey, {ChPid, NewAState}), + post_process_frame(Frame, ChPid, State); + {ok, Method, Content, NewAState} -> + rabbit_channel:do_flow(ChPid, Method, Content), + put(ChKey, {ChPid, NewAState}), + post_process_frame(Frame, ChPid, control_throttle(State)); + {error, Reason} -> + handle_exception(State, Channel, Reason) end. post_process_frame({method, 'channel.close_ok', _}, ChPid, State) -> |
