From 672968d6e913e02931cc689f1221aa7e87ca4d8e Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 01:02:03 +0000 Subject: [PATCH] erlang thrift_client: wrap gen_tcp:connect in a catch ... leave nothing to chance git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666449 13f79535-47bb-0310-9956-ffa450edef68 --- lib/alterl/src/thrift_client.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/alterl/src/thrift_client.erl b/lib/alterl/src/thrift_client.erl index a88c22c4..0b6c501c 100644 --- a/lib/alterl/src/thrift_client.erl +++ b/lib/alterl/src/thrift_client.erl @@ -71,7 +71,7 @@ init([Host, Port, Service, Options]) -> {nodelay, true}], TcpTimeout = State#state.connect_timeout, - case gen_tcp:connect(Host, Port, TcpOptions, TcpTimeout) of + case catch gen_tcp:connect(Host, Port, TcpOptions, TcpTimeout) of {ok, Sock} -> {ok, Transport} = thrift_socket_transport:new(Sock), {ok, BufTransport} = @@ -80,8 +80,8 @@ init([Host, Port, Service, Options]) -> false -> thrift_buffered_transport:new(Transport) end, {ok, Protocol} = thrift_binary_protocol:new(BufTransport, - [{strict_read, State#state.strict_read}, - {strict_write, State#state.strict_write}]), + [{strict_read, State#state.strict_read}, + {strict_write, State#state.strict_write}]), {ok, State#state{service = Service, protocol = Protocol, -- 2.17.1