diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-01-20 16:47:23 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-01-20 16:47:23 +0000 |
| commit | 3aff2ac175d681b1b7d68b2a2cf0f12004180fcc (patch) | |
| tree | ad0713ffc2e9f584ac9b828682d11f12be37badb /src | |
| parent | 1c7ea9f1875eb3cbefab5828932b6aa1b7caf255 (diff) | |
| download | rabbitmq-server-git-3aff2ac175d681b1b7d68b2a2cf0f12004180fcc.tar.gz | |
handle errors in list_consumers
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index 78391be2ef..4228ff7fd3 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -273,10 +273,13 @@ action(list_consumers, Node, _Args, Opts, Inform) -> Inform("Listing consumers", []), VHostArg = list_to_binary(proplists:get_value(?VHOST_OPT, Opts)), InfoKeys = [queue_name, channel_pid, consumer_tag, ack_required], - display_info_list( - [lists:zip(InfoKeys, tuple_to_list(X)) || - X <- rpc_call(Node, rabbit_amqqueue, consumers_all, [VHostArg])], - InfoKeys); + case rpc_call(Node, rabbit_amqqueue, consumers_all, [VHostArg]) of + L when is_list(L) -> display_info_list( + [lists:zip(InfoKeys, tuple_to_list(X)) || + X <- L], + InfoKeys); + Other -> Other + end; action(set_permissions, Node, [Username, CPerm, WPerm, RPerm], Opts, Inform) -> VHost = proplists:get_value(?VHOST_OPT, Opts), |
