[Zope] xmlrpc error handling

Kevin plone at kevinkal.com
Wed Apr 11 13:38:21 EDT 2007


In order to avoid zodb implosion, is it sufficient to raise an xmlrpclib
Fault object from a method where some validation was not successful?
Will zope abort transactions and avoid an other avoidable bad things
from happening?  Do I have to use fault or can I raise just any error an
ZPublisher.xmlrpc will marshall it
into <fault></fault>?

from xmlrpclib import Fault
SomeClass(SimpleItem):
   ...
   def myMethod(self,stuff=[]):
         if type(stuff) != list:
            f=Fault
            f(27,"stuff must be a list")
            raise f
         else:
              print stuff

Thanks,
Kevin




More information about the Zope mailing list