Skip to content

Commit

Permalink
HSM ValueError improved
Browse files Browse the repository at this point in the history
As mentioned in #238, the ValueError raised when an incompatible type should be added, has not been clear. Mention the requirement specifically in the error message.
  • Loading branch information
aleneum committed Jul 19, 2017
1 parent 19ec2ab commit 9f7cbe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transitions/extensions/nesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def traverse(self, states, on_enter=None, on_exit=None,
elif isinstance(state, NestedState):
tmp_states.append(state)
else:
raise ValueError("%s cannot be added to the machine since its type is not known." % state)
raise ValueError("%s is not an instance or subclass of NestedState "
"required by HierarchicalMachine." % state)
new_states.extend(tmp_states)

duplicate_check = []
Expand Down

0 comments on commit 9f7cbe3

Please sign in to comment.