From: David Reiss Date: Wed, 11 Jun 2008 01:02:03 +0000 (+0000) Subject: erlang thrift_client: wrap gen_tcp:connect in a catch ... leave nothing to chance X-Git-Tag: 0.2.0~713 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=672968d6e913e02931cc689f1221aa7e87ca4d8e;p=common%2Fthrift.git 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 --- 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,