Implement TApplicationException handling in alt_erl client
Summary:
Throws a 'TApplicationException' record
Test plan:
Changed cpp TestServer so that if testException is called with "ApplicationException" as an argument, it throws a TException which is serialized back as an EXCEPTION type message
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666421 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 14a8a8e..0c58a29 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -222,13 +222,18 @@
hello.i64_thing = (int64_t)arg2;
}
- void testException(const std::string &arg) throw(Xception) {
+ void testException(const std::string &arg)
+ throw(Xception, facebook::thrift::TException)
+ {
printf("testException(%s)\n", arg.c_str());
if (arg.compare("Xception") == 0) {
Xception e;
e.errorCode = 1001;
e.message = "This is an Xception";
throw e;
+ } else if (arg.compare("ApplicationException") == 0) {
+ facebook::thrift::TException e;
+ throw e;
} else {
Xtruct result;
result.string_thing = arg;