From b5faad29d77f876640eb1247b49d088035ef2e2a Mon Sep 17 00:00:00 2001 From: Emile Joubert Date: Wed, 25 Sep 2013 10:01:06 +0100 Subject: Genericise network messages --- src/rabbit_direct.erl | 5 ++--- src/rabbit_reader.erl | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rabbit_direct.erl b/src/rabbit_direct.erl index 1577b0d5..5a004792 100644 --- a/src/rabbit_direct.erl +++ b/src/rabbit_direct.erl @@ -92,9 +92,8 @@ connect0(AuthFun, VHost, Protocol, Pid, Infos) -> true -> case AuthFun() of {ok, User} -> connect(User, VHost, Protocol, Pid, Infos); - {refused, Msg, Args} -> - Reason = io_lib:format(Msg, Args), - {error, {auth_failure, Reason}} + {refused, _M, _A} -> + {error, {auth_failure, "Refused"}} end; false -> {error, broker_not_found_on_node} end. diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index bc82318a..11982778 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -978,8 +978,9 @@ auth_phase(Response, case rabbit_misc:table_lookup(Capabilities, <<"authentication_failure_close">>) of {bool, true} -> + AmqpError1 = AmqpError#amqp_error{explanation = "Refused"}, {0, CloseMethod} = rabbit_binary_generator:map_exception( - 0, AmqpError, Protocol), + 0, AmqpError1, Protocol), ok = send_on_channel0(State#v1.sock, CloseMethod, Protocol); _ -> ok end, -- cgit v1.2.1