Don't allow async (no return) functions that throw exceptions.
authorDavid Reiss <dreiss@apache.org>
Fri, 14 Mar 2008 00:51:42 +0000 (00:51 +0000)
committerDavid Reiss <dreiss@apache.org>
Fri, 14 Mar 2008 00:51:42 +0000 (00:51 +0000)
This wouldn't work anyway.  Better to catch it early.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665570 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/parse/t_function.h

index ed1c73c..74dac63 100644 (file)
@@ -41,7 +41,12 @@ class t_function : public t_doc {
     name_(name),
     arglist_(arglist),
     xceptions_(xceptions),
-    async_(async) {}
+    async_(async)
+  {
+    if (async_ && !xceptions_->get_members().empty()) {
+      throw std::string("Async methods can't throw exceptions.");
+    }
+  }
 
   ~t_function() {}