Skip to content

Commit

Permalink
Use new functionality to give a more precise error
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Nov 9, 2023
1 parent 11f2757 commit 6e29a72
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions k4FWCore/components/PodioOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,16 @@ StatusCode PodioOutput::execute() {
} else {
try {
m_framewriter->writeFrame(frame, "events", m_collection_names_to_write);
} catch (std::runtime_error& e) {
error() << "Could not write event: " << e.what() << endmsg;
} catch (std::runtime_error&) {
const auto& [missing, _] = m_framewriter->checkConsistency(m_collection_names_to_write, "events");
error() << "Could not write event, because the following collections are not present: ";
std::string sep = "";
for (const auto& n : missing) {
error() << sep << n;
sep = ", ";
}
error() << endmsg;

return StatusCode::FAILURE;
}
}
Expand Down

0 comments on commit 6e29a72

Please sign in to comment.