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
commitdf11cdaf73e3d984a40d719ad170cabc6f24c5ba (patch)
treec7077544f90f0f034b786aee9cf9ec5c51e3f7d3
parent4f234daa3c4a7f65e4ec8ad0fbc624474b075b9b (diff)
parent7419354adf9f861f18cf9aeb2ea3a7d6ada839ce (diff)
downloadrabbitmq-server-df11cdaf73e3d984a40d719ad170cabc6f24c5ba.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 f4dbdf34..f96e69eb 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).