From: David Reiss Date: Fri, 14 Mar 2008 00:51:42 +0000 (+0000) Subject: Don't allow async (no return) functions that throw exceptions. X-Git-Tag: 0.2.0~902 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=6d94390375e865e0c774df1dc072ea1774eba7b1;p=common%2Fthrift.git Don't allow async (no return) functions that throw exceptions. 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 --- diff --git a/compiler/cpp/src/parse/t_function.h b/compiler/cpp/src/parse/t_function.h index ed1c73c7..74dac635 100644 --- a/compiler/cpp/src/parse/t_function.h +++ b/compiler/cpp/src/parse/t_function.h @@ -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() {}