THRIFT-3011 C# test server testException() not implemented according to specs
Client: C#
Patch: Jens Geyer
diff --git a/lib/csharp/test/ThriftTest/TestServer.cs b/lib/csharp/test/ThriftTest/TestServer.cs
index 615ead8..2096cf8 100644
--- a/lib/csharp/test/ThriftTest/TestServer.cs
+++ b/lib/csharp/test/ThriftTest/TestServer.cs
@@ -293,6 +293,13 @@
return hello;
}
+ /**
+ * Print 'testException(%s)' with arg as '%s'
+ * @param string arg - a string indication what type of exception to throw
+ * if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
+ * elsen if arg == "TException" throw TException
+ * else do not throw anything
+ */
public void testException(string arg)
{
Console.WriteLine("testException(" + arg + ")");
@@ -300,9 +307,13 @@
{
Xception x = new Xception();
x.ErrorCode = 1001;
- x.Message = "This is an Xception";
+ x.Message = arg;
throw x;
}
+ if (arg == "TException")
+ {
+ throw new Thrift.TException();
+ }
return;
}