diff options
author | Vlad Alexandru Ionescu <vlad@rabbitmq.com> | 2011-01-27 14:11:05 +0000 |
---|---|---|
committer | Vlad Alexandru Ionescu <vlad@rabbitmq.com> | 2011-01-27 14:11:05 +0000 |
commit | d87d30e6b51556643cc2b674b71b1917e05a019f (patch) | |
tree | e93bff4c61d88e5293432318099a891bc106182b | |
parent | 2d286f26295a4a11141b572d3bb9183b9dc3db3e (diff) | |
download | rabbitmq-server-d87d30e6b51556643cc2b674b71b1917e05a019f.tar.gz |
changing exit's to {error,}'s in rabbit_direct:connect/3
-rw-r--r-- | src/rabbit_direct.erl | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/rabbit_direct.erl b/src/rabbit_direct.erl index 1bb5e5ce..3b8c9fba 100644 --- a/src/rabbit_direct.erl +++ b/src/rabbit_direct.erl @@ -51,20 +51,21 @@ boot() -> connect(Username, Password, VHost) -> case lists:keymember(rabbit, 1, application:which_applications()) of - true -> ok; - false -> exit(broker_not_found_in_vm) - end, - User = try rabbit_access_control:user_pass_login(Username, Password) of - #user{} = User1 -> User1 - catch - exit:#amqp_error{name = access_refused} -> exit(auth_failure) - end, - try rabbit_access_control:check_vhost_access(User, VHost) of - ok -> ok - catch - exit:#amqp_error{name = access_refused} -> exit(access_refused) - end, - {ok, {User, rabbit_reader:server_properties()}}. + true -> + try rabbit_access_control:user_pass_login(Username, Password) of + #user{} = User -> + try rabbit_access_control:check_vhost_access(User, VHost) of + ok -> {ok, {User, rabbit_reader:server_properties()}} + catch + exit:#amqp_error{name = access_refused} -> + {error, access_refused} + end + catch + exit:#amqp_error{name = access_refused} -> {error, auth_failure} + end; + false -> + {error, broker_not_found_on_node} + end. start_channel(Number, ClientChannelPid, User, VHost, Collector) -> {ok, _, {ChannelPid, _}} = |