Reply with InvalidState error when a message is not applicable to the
current state machine's state.