Update message when processing event and not initialized

This commit is contained in:
Joshua Harlow 2014-12-10 12:57:57 -08:00
parent 8c897cfa6f
commit eb169daa98
1 changed files with 3 additions and 2 deletions

View File

@ -186,8 +186,9 @@ class FiniteMachine(object):
def _pre_process_event(self, event):
current = self._current
if current is None:
raise excp.NotInitialized("Can only process events after"
" being initialized (not before)")
raise excp.NotInitialized("Can not process event '%s'; the state"
" machine hasn't been initialized"
% event)
if self._states[current.name]['terminal']:
raise excp.InvalidState("Can not transition from terminal"
" state '%s' on event '%s'"