Skip to content

Commit

Permalink
Better context for exception during reading of ParameterSets
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr15Jones committed Feb 7, 2024
1 parent 8d4a4cc commit 0524ea0
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions IOPool/Input/src/RootFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,23 @@ namespace edm {
} else {
// Merge into the parameter set registry.
pset::Registry& psetRegistry = *pset::Registry::instance();
for (auto const& psetEntry : psetMap) {
ParameterSet pset(psetEntry.second.pset());
pset.setID(psetEntry.first);
// For thread safety, don't update global registries when a secondary source opens a file.
if (inputType != InputType::SecondarySource) {
psetRegistry.insertMapped(pset);
try {
for (auto const& psetEntry : psetMap) {
ParameterSet pset(psetEntry.second.pset());
pset.setID(psetEntry.first);
// For thread safety, don't update global registries when a secondary source opens a file.
if (inputType != InputType::SecondarySource) {
psetRegistry.insertMapped(pset);
}
}
} catch (edm::Exception const& iExcept) {
if (iExcept.categoryCode() == edm::errors::Configuration) {
edm::Exception exception(edm::errors::FormatIncompatibility);
exception << iExcept.message();
exception.addContext("Creating ParameterSets from file");
throw exception;
} else {
throw;
}
}
}
Expand Down

0 comments on commit 0524ea0

Please sign in to comment.