summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-02-02 15:33:16 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-02-02 15:33:16 +0000
commit690dc6defcabe23efde8347b8fa8eb59097a1582 (patch)
tree5e867bc6b11f47b0cf53235fc7889223e05487fb
parent21db59fcddc97fbe5013575dca83aec746f4d884 (diff)
parentcba5108d3b01d12c3a8d74b1a18434534cabab1e (diff)
downloadrabbitmq-server-690dc6defcabe23efde8347b8fa8eb59097a1582.tar.gz
Merged heads
-rw-r--r--src/rabbit_misc.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 3a4fb024..7d916797 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -240,11 +240,20 @@ assert_args_equivalence1(Orig, New, Name, Key) ->
{Same, Same} -> ok;
{Orig1, New1} -> protocol_error(
precondition_failed,
- "inequivalent arg '~s' for ~s: "
- "required ~w, received ~w",
- [Key, rabbit_misc:rs(Name), New1, Orig1])
+ "inequivalent arg '~s' for ~s: "
+ "received ~s but current is ~s",
+ [Key, rs(Name), val(New1), val(Orig1)])
end.
+val(undefined) ->
+ "none";
+val({Type, Value}) ->
+ Fmt = case is_binary(Value) of
+ true -> "the value '~s' of type '~s'";
+ false -> "the value '~w' of type '~s'"
+ end,
+ lists:flatten(io_lib:format(Fmt, [Value, Type])).
+
dirty_read(ReadSpec) ->
case mnesia:dirty_read(ReadSpec) of
[Result] -> {ok, Result};