Skip to content

Commit

Permalink
If TClass::GetClass() fails, include the argument class name in the e…
Browse files Browse the repository at this point in the history
…xception message

This should help in figuring out what class did not have a ROOT
dictionary defined.
  • Loading branch information
makortel committed Mar 27, 2024
1 parent f1dac78 commit c247d6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion FWCore/Reflection/src/TypeWithDict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ namespace edm {
}

// Handle classes
TClass* theClass = TClass::GetClass(name.c_str());
TClass* theClass = nullptr;
try {
theClass = TClass::GetClass(name.c_str());
} catch(cms::Exception& e) {
e.addContext("Calling edm::TypeWithDict::byName()");
e.addAdditionalInfo("Getting TClass for "+name);
throw;
}
if (theClass != nullptr) {
return TypeWithDict(theClass, property);
}
Expand Down

0 comments on commit c247d6f

Please sign in to comment.