summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Fedotov <hairyhum@gmail.com>2016-04-13 18:19:30 +0100
committerDaniil Fedotov <hairyhum@gmail.com>2016-04-13 18:19:30 +0100
commitb943c0d1677a42e1763d71159b7b84d519ad3cf2 (patch)
tree9cb8baddea6e94d63e12bc35e13d255e0aec5467 /src
parent68c940985669c7fc1951234cedae0dd3ab5dfbc8 (diff)
parentf9c558d49d60362d9cbbf9284c458a6c83f16f85 (diff)
downloadrabbitmq-server-git-b943c0d1677a42e1763d71159b7b84d519ad3cf2.tar.gz
Merge pull request #743 from rabbitmq/rabbitmq-server-742
rabbitmqctl set_policy: Format error messages
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_control_main.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index d4d6166276..f63694b657 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -508,9 +508,15 @@ action(set_policy, Node, [Key, Pattern, Defn], Opts, Inform) ->
PriorityArg = proplists:get_value(?PRIORITY_OPT, Opts),
ApplyToArg = list_to_binary(proplists:get_value(?APPLY_TO_OPT, Opts)),
Inform(Msg, [Key, Pattern, Defn, PriorityArg]),
- rpc_call(
+ Res = rpc_call(
Node, rabbit_policy, parse_set,
- [VHostArg, list_to_binary(Key), Pattern, Defn, PriorityArg, ApplyToArg]);
+ [VHostArg, list_to_binary(Key), Pattern, Defn, PriorityArg, ApplyToArg]),
+ case Res of
+ {error, Format, Args} when is_list(Format) andalso is_list(Args) ->
+ {error_string, rabbit_misc:format(Format, Args)};
+ _ ->
+ Res
+ end;
action(clear_policy, Node, [Key], Opts, Inform) ->
VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)),