From 6d94390375e865e0c774df1dc072ea1774eba7b1 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 14 Mar 2008 00:51:42 +0000 Subject: [PATCH] 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 --- compiler/cpp/src/parse/t_function.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() {} -- 2.17.1