From: Henrique Mendonca Date: Mon, 24 Sep 2012 18:36:16 +0000 (+0000) Subject: Thrift-1696:Compiler fails if namespace of an unknown language is present in the IDL X-Git-Tag: 0.9.1~306 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=ffb031d74ea3dbcfe271bd098fbe8642f57f7e69;p=common%2Fthrift.git Thrift-1696:Compiler fails if namespace of an unknown language is present in the IDL Patch: Abhishek Kona print warning instead of throwing an exception git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1389509 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h index 0d05eede..60a47d04 100644 --- a/compiler/cpp/src/parse/t_program.h +++ b/compiler/cpp/src/parse/t_program.h @@ -182,13 +182,14 @@ class t_program : public t_doc { it=my_copy.find(base_language); if (it == my_copy.end()) { - throw "No generator named '" + base_language + "' could be found!"; - } - - if (sub_index != std::string::npos) { - std::string sub_namespace = language.substr(sub_index+1); - if(! it->second->is_valid_namespace(sub_namespace)) { - throw base_language +" generator does not accept '" + sub_namespace + "' as sub-namespace!"; + std::string warning = "No generator named '" + base_language + "' could be found!"; + pwarning(1, warning.c_str()); + } else { + if (sub_index != std::string::npos) { + std::string sub_namespace = language.substr(sub_index+1); + if ( ! it->second->is_valid_namespace(sub_namespace)) { + throw base_language + " generator does not accept '" + sub_namespace + "' as sub-namespace!"; + } } } }