You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by he...@apache.org on 2012/09/24 20:36:17 UTC
svn commit: r1389509 - /thrift/trunk/compiler/cpp/src/parse/t_program.h
Author: henrique
Date: Mon Sep 24 18:36:16 2012
New Revision: 1389509
URL: http://svn.apache.org/viewvc?rev=1389509&view=rev
Log:
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
Modified:
thrift/trunk/compiler/cpp/src/parse/t_program.h
Modified: thrift/trunk/compiler/cpp/src/parse/t_program.h
URL: http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/parse/t_program.h?rev=1389509&r1=1389508&r2=1389509&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/parse/t_program.h (original)
+++ thrift/trunk/compiler/cpp/src/parse/t_program.h Mon Sep 24 18:36:16 2012
@@ -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!";
+ }
}
}
}