Skip to content

Commit

Permalink
Clearer error message
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Feb 23, 2024
1 parent 08a7f74 commit 1d1d8ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neo/core/objectlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _handle_append(self, obj):
raise TypeError(f"Object is a {type(obj)}. It should be one of {self.allowed_contents}.")

if self._contains(obj):
raise ValueError("Cannot add the same object twice")
raise ValueError("Cannot add this object because it is already contained within the list")

# set the child-parent relationship
if self.parent:
Expand Down

0 comments on commit 1d1d8ae

Please sign in to comment.