anchor.diff:  
   %% @doc Process the request over thrift
   -spec process_request(connection(), request(), #state{}) -> {connection(), response()}.
  -process_request(Connection, Request, #state{binary_response = BinaryResponse}) ->
  -    {Connection1, RestResponse} = thrift_client:call(Connection, 'execute', [Request]),
  +process_request(undefined, Request, State = #state{connection_options = ConnectionOptions,
  +                                                   binary_response = BinaryResponse}) ->
  +    Connection = connection(ConnectionOptions),
  +    {Connection1, RestResponse} = do_request(Connection, {'execute', [Request]}, State),
  +    {Connection1, process_response(BinaryResponse, RestResponse)};
  +process_request(Connection, Request, State = #state{binary_response = BinaryResponse}) ->
  +    {Connection1, RestResponse} = do_request(Connection, {'execute', [Request]}, State),
       {Connection1, process_response(BinaryResponse, RestResponse)}.
  +
  +-spec do_request(connection(), request(), #state{}) -> {connection(), response()}.
  +do_request(Connection, {Function, Args}, _State) ->
  +    try thrift_client:call(Connection, Function, Args) of
  +        {Connection1, Response = {ok, _}} ->
  +            {Connection1, Response};
  +        {Connection1, Response = {error, _}} ->
  +            {Connection1, Response}
  +    catch
  +        Exception:Reason ->
  +            case {Exception, Reason} of
  +                {throw, {Connection1, Response = {exception, _}}} ->
  +                    {Connection1, Response};
  +                % Thrift client closes the connection
  +                {error, {case_clause,{error, closed}}} ->
  +                    {undefined, {error, badarg}};
  +                {error, {case_clause,{error, econnrefused}}} ->
  +                    {undefined, {error, econnrefused}};
  +                {error, badarg} ->
  +                    {Connection, {error, badarg}}
  +
  +            end
  +    end.
  +
   
   -spec process_response(boolean(), response()) -> response().
   process_response(_, {error, _} = Response) ->
  
positive.code:     Connection = connection(ConnectionOptions),
      {ok, #state{client_name = ClientName, 
                  binary_response = DecodeResponse,
                  connection = Connection}}.
  
  handle_call({stop}, _From, State) ->
  
negative.code: -record(state, {
          client_name                         :: client_name(),
          binary_response = false             :: boolean(),
          connection_options = []             :: params(),
          connection                          :: connection()}).
  
  %% ------------------------------------------------------------------
  