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 a88c22c..0b6c501 100644
--- a/lib/alterl/src/thrift_client.erl
+++ b/lib/alterl/src/thrift_client.erl
@@ -71,7 +71,7 @@
                   {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 @@
                     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,