Skip to content

Commit

Permalink
Improve error message for push_back when using an immutable type (#577)
Browse files Browse the repository at this point in the history
Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
  • Loading branch information
jmcarcell and jmcarcell authored Apr 10, 2024
1 parent 2c87bf3 commit 5964958
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/templates/Collection.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void {{ collection_type }}::push_back(Mutable{{ class.bare_type }} object) {

void {{ collection_type }}::push_back({{ class.bare_type }} object) {
if (!m_isSubsetColl) {
throw std::invalid_argument("Can only add immutable objects to subset collections");
throw std::invalid_argument("Immutable objects can only be added to subset collections");
}
auto obj = object.m_obj;
if (obj->id.index < 0) {
Expand Down

0 comments on commit 5964958

Please # to comment.