[Zope] Site Navigation problem

Dieter Maurer dieter@handshake.de
Wed, 4 Sep 2002 20:25:07 +0200


Nico de Boer writes:
 > ...
 > 				if self.methodTestOk('tree_item_active'):
 >                     # call the dtml-method from python
 > 					return self.NavItem(self.tree_item_active)
 > ...
 > The
 > problem with my code is that I don't get any error message if one of
 > the methods is deleted. I get a None object back. Is it possible that
 > methodTestOk returns the errormessage?
Sure, you use

      if methodTestOk(...): return ...
      else: raise AttributeError, what_is_missing

Of course, you would use a different exception, when it fits better.


Dieter