summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-07-30 20:04:07 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-07-30 20:04:07 +0100
commitc929581c5d29e55dd9c036e6ddeb8cd4b8be6200 (patch)
treec7077544f90f0f034b786aee9cf9ec5c51e3f7d3
parent1bcb40284def8ae490a4dc9356bcd829e081aa2b (diff)
parent656269bcfb28437820f2814bdb2fcbe593debb9d (diff)
downloadrabbitmq-server-git-c929581c5d29e55dd9c036e6ddeb8cd4b8be6200.tar.gz
merge bug22886 into default
-rw-r--r--src/rabbit_framing_channel.erl33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/rabbit_framing_channel.erl b/src/rabbit_framing_channel.erl
index f4dbdf34a2..f96e69eb80 100644
--- a/src/rabbit_framing_channel.erl
+++ b/src/rabbit_framing_channel.erl
@@ -88,10 +88,9 @@ mainloop(ChannelPid, Protocol) ->
end,
?MODULE:mainloop(ChannelPid, Protocol);
_ ->
- rabbit_misc:protocol_error(
- unexpected_frame,
- "expected method frame, got ~p instead",
- [Decoded])
+ unexpected_frame("expected method frame, "
+ "got non method frame instead",
+ [])
end.
collect_content(ChannelPid, ClassId, Protocol) ->
@@ -104,17 +103,13 @@ collect_content(ChannelPid, ClassId, Protocol) ->
protocol = Protocol,
payload_fragments_rev = Payload};
{content_header, HeaderClassId, 0, _BodySize, _PropertiesBin} ->
- rabbit_misc:protocol_error(
- unexpected_frame,
- "expected content header for class ~w, "
- "got one for class ~w instead",
- [ClassId, HeaderClassId]);
+ unexpected_frame("expected content header for class ~w, "
+ "got one for class ~w instead",
+ [ClassId, HeaderClassId]);
_ ->
- rabbit_misc:protocol_error(
- unexpected_frame,
- "expected content header for class ~w, "
- "got non content header frame instead",
- [ClassId])
+ unexpected_frame("expected content header for class ~w, "
+ "got non content header frame instead",
+ [ClassId])
end.
collect_content_payload(_ChannelPid, 0, Acc) ->
@@ -126,8 +121,10 @@ collect_content_payload(ChannelPid, RemainingByteCount, Acc) ->
RemainingByteCount - size(FragmentBin),
[FragmentBin | Acc]);
_ ->
- rabbit_misc:protocol_error(
- unexpected_frame,
- "expected content body, got non content body frame instead",
- [])
+ unexpected_frame("expected content body, "
+ "got non content body frame instead",
+ [])
end.
+
+unexpected_frame(ExplanationFormat, Params) ->
+ rabbit_misc:protocol_error(unexpected_frame, ExplanationFormat, Params).