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
This commit is contained in:
Henrique Mendonca 2012-09-24 18:36:16 +00:00
parent 962b35309d
commit ffb031d74e

View File

@ -182,9 +182,9 @@ class t_program : public t_doc {
it=my_copy.find(base_language); it=my_copy.find(base_language);
if (it == my_copy.end()) { if (it == my_copy.end()) {
throw "No generator named '" + base_language + "' could be found!"; std::string warning = "No generator named '" + base_language + "' could be found!";
} pwarning(1, warning.c_str());
} else {
if (sub_index != std::string::npos) { if (sub_index != std::string::npos) {
std::string sub_namespace = language.substr(sub_index+1); std::string sub_namespace = language.substr(sub_index+1);
if ( ! it->second->is_valid_namespace(sub_namespace)) { if ( ! it->second->is_valid_namespace(sub_namespace)) {
@ -192,6 +192,7 @@ class t_program : public t_doc {
} }
} }
} }
}
namespaces_[language] = name_space; namespaces_[language] = name_space;
} }