[Twisted-Python] passing exceptions to an xmlrpc client

Justin Johnson justinjohnson at fastmail.fm
Wed Jun 18 11:02:26 MDT 2003


When doing something like:

proxy.callRemote('add', 1, 2).addCallbacks(printValue, printError)

...my understanding is that the callback function (printValue) will get
called unless an exception is raised by 'add', or 'add' returns a
twisted.python.failure.Failure.  However, if I am calling a remote method
on a twisted xmlrpc service, raised exceptions and returned Failure's
can't really be returned to the client side.  So really my errback would
only get called if there were some other problem with the service, like
loss of network connection or something like that, right?  If I use the
perspective broker will I be able to raise exceptions or return failures
in my remote methods and have them get passed back to the client
appropriately?  I'm trying to make sure I can handle all errors in my
errbacks, and not have to do some special processing of errors specific
to my method in the callbacks.

Thanks.
-Justin




More information about the Twisted-Python mailing list