diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-04-13 12:30:25 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-04-13 12:30:25 +0200 |
| commit | f9c558d49d60362d9cbbf9284c458a6c83f16f85 (patch) | |
| tree | 9cb8baddea6e94d63e12bc35e13d255e0aec5467 | |
| parent | 68c940985669c7fc1951234cedae0dd3ab5dfbc8 (diff) | |
| download | rabbitmq-server-git-f9c558d49d60362d9cbbf9284c458a6c83f16f85.tar.gz | |
rabbitmqctl set_policy: Format error messages
References #742.
[#117521029]
| -rw-r--r-- | src/rabbit_control_main.erl | 10 |
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)), |
