Skip to content

Commit

Permalink
collections.jinja2: improve exception message for untracked relation (#…
Browse files Browse the repository at this point in the history
…728)

* collections.jinja2: improve exception message for untracked relation

* mention name in the message
  • Loading branch information
veprbl authored Jan 21, 2025
1 parent 4291447 commit 4e41eb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/templates/macros/collections.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std::vector<{{ member.full_type }}> {{ class.bare_type }}Collection::{{ member.n
{{ _relation_index_handling(relation) }}
for (const auto& it : (*m_rel_{{ relation.name }}_tmp[i])) {
if (it.getObjectID().index == podio::ObjectID::untracked) {
throw std::runtime_error("Trying to persistify untracked object");
throw std::runtime_error("Trying to persistify relation \"{{ relation.name }}\" that points to untracked object");
}
m_refCollections[{{ index }}]->emplace_back(it.getObjectID());
}
Expand All @@ -48,7 +48,7 @@ std::vector<{{ member.full_type }}> {{ class.bare_type }}Collection::{{ member.n
if (obj->m_{{ relation.name }}) {
m_refCollections[{{ real_index }}]->emplace_back(obj->m_{{ relation.name }}->getObjectID());
} else {
m_refCollections[{{ real_index }}]->push_back({podio::ObjectID::invalid, 0});
m_refCollections[{{ real_index }}]->push_back({podio::ObjectID::invalid, 0});
}
}
{% endmacro %}
Expand Down

0 comments on commit 4e41eb9

Please sign in to comment.