diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-12-20 23:17:03 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-12-20 23:17:03 +0000 |
commit | fd7a2f9525702e8920a956111bb4adcc2b57ae24 (patch) | |
tree | d6cd18102818223fb2685904781caada5852b45a | |
parent | 69315f79746877333b130074389e77298ac18649 (diff) | |
download | rabbitmq-server-fd7a2f9525702e8920a956111bb4adcc2b57ae24.tar.gz |
include stack trace in errors caught by channel
and catch throws too, which previously were not caught
-rw-r--r-- | src/rabbit_channel.erl | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 5d7fde90..07d55d04 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -111,20 +111,23 @@ init(ProxyPid, [ReaderPid, WriterPid, Username, VHost]) -> consumer_mapping = dict:new()}. handle_message({method, Method, Content}, State) -> - case (catch 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); - {'EXIT', {amqp, Error, Explanation, none}} -> + 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 + catch + exit:{amqp, Error, Explanation, none} -> terminate({amqp, Error, Explanation, rabbit_misc:method_record_type(Method)}, State); - {'EXIT', Reason} -> - terminate(Reason, State) + _:Reason -> + terminate({Reason, erlang:get_stacktrace()}, State) end; handle_message(terminate, State) -> |