THRIFT-4377: more informative error messages on tests
THRIFT-4377: fix haxe-php integration
Client: haxe

This closes #1407
diff --git a/lib/haxe/src/org/apache/thrift/server/TSimpleServer.hx b/lib/haxe/src/org/apache/thrift/server/TSimpleServer.hx
index 655a629..0600744 100644
--- a/lib/haxe/src/org/apache/thrift/server/TSimpleServer.hx
+++ b/lib/haxe/src/org/apache/thrift/server/TSimpleServer.hx
@@ -121,7 +121,7 @@
                 logDelegate(e); // Unexpected
             }
 
-            if(client != null)
+            if(client != null && !runOnce)
             {
                 client.close();
             }
diff --git a/test/haxe/src/TestClient.hx b/test/haxe/src/TestClient.hx
index 9f02499..853319e 100644
--- a/test/haxe/src/TestClient.hx
+++ b/test/haxe/src/TestClient.hx
@@ -444,6 +444,10 @@
             rslt.Expect( e.message == "Xception", 'testException("Xception")  -  e.message == "Xception"');
             rslt.Expect( e.errorCode == 1001, 'testException("Xception")  -  e.errorCode == 1001');
         }
+        catch (e : TException)
+        {
+            rslt.Expect( false, 'testException("Xception")  -  ${e} : ${e.errorMsg}');
+        }
         catch (e : Dynamic)
         {
             rslt.Expect( false, 'testException("Xception")  -  $e');
@@ -457,7 +461,7 @@
         }
         catch (e : TException)
         {
-            rslt.Expect( true, 'testException("TException")  -  $e');
+            rslt.Expect( true, 'testException("TException")  -  $e : ${e.errorMsg}');
         }
         catch (e : Dynamic)
         {
@@ -475,6 +479,10 @@
             client.testException("bla");
             rslt.Expect( true, 'testException("bla") should not throw');
         }
+        catch (e : TException)
+        {
+            rslt.Expect( false, 'testException("bla")  -  ${e} : ${e.errorMsg}');
+        }
         catch (e : Dynamic)
         {
             rslt.Expect( false, 'testException("bla")  -  $e');