THRIFT-2110 Erlang: Support for Multiplexing Services on any Transport, Protocol and Server
Client: Erlang
Patch: David Robakowski rebased by Nobuaki Sukegawa

Modification: Return value fix in thrift_client uncovered by added tests
diff --git a/lib/erl/src/thrift_client.erl b/lib/erl/src/thrift_client.erl
index 209bd4c..7bf50a5 100644
--- a/lib/erl/src/thrift_client.erl
+++ b/lib/erl/src/thrift_client.erl
@@ -39,6 +39,7 @@
 when is_atom(Function), is_list(Args) ->
   case send_function_call(Client, Function, Args) of
     {ok, Client1} -> receive_function_result(Client1, Function);
+    {{error, X}, Client1} -> {Client1, {error, X}};
     Else -> Else
   end.
 
@@ -66,7 +67,7 @@
 send_function_call(Client = #tclient{service = Service}, Function, Args) ->
   {Params, Reply} = try
     {Service:function_info(Function, params_type), Service:function_info(Function, reply_type)}
-  catch error:function_clause -> no_function
+  catch error:function_clause -> {no_function, 0}
   end,
   MsgType = case Reply of
     oneway_void -> ?tMessageType_ONEWAY;