diff --git a/FWCore/Utilities/src/TypeWithDict.cc b/FWCore/Utilities/src/TypeWithDict.cc index 8b09cdcc65f3c..8115d66dd8cf8 100644 --- a/FWCore/Utilities/src/TypeWithDict.cc +++ b/FWCore/Utilities/src/TypeWithDict.cc @@ -354,7 +354,24 @@ namespace edm { TypeWithDict::typeInfo() const { if(*ti_ == typeid(dummyType) || isPointer() || isArray()) { // No accurate type_info - assert(qualifiedName().c_str() == nullptr); + if(qualifiedName().c_str() != nullptr) { + std::string category("unknown"); + if(isPointer()) { + category = "a pointer"; + } else if(isArray()) { + category = "an array"; + } else if(isEnum()) { + category = "an enum"; + } else if(isClass()) { + throw Exception(errors::DictionaryNotFound) + << "No Dictionary for class: '" << name() << "'" << std::endl; + } + throw Exception(errors::LogicError) + << "Function TypeWithDict::typeInfo: Type\n" + << qualifiedName() + << "\ndoes not have valid type_info information in ROOT\n" + << "because it is " << category << ".\n"; + } } return *ti_; } @@ -490,6 +507,8 @@ namespace edm { out << "::"; } out << enum_->GetName(); + } else if (*ti_ == typeid(dummyType) && isClass()) { + out << class_->GetName(); } else { out << TypeID(*ti_).className(); }