[Twisted-Python] Trouble with pb.CopyableFailure
justinjohnson at gmail.com
Wed Nov 10 16:36:57 EST 2004
I am trying to get pb.CopyableFailure to work, but am getting
The following module is imported by both client and server.
from twisted.spread import pb, jelly
"""Base class for exceptions in this module."""
class WebViewOnDifferentServer(Error, pb.CopyableFailure, pb.RemoteCopy):
def __init__(self, viewTag, server):
self.viewTag = viewTag
self.server = server
return "WebViewOnDifferentServer: viewTag=%s, server=%s" %
The client and server both contain the following 2 lines of code.
from ratcontrol import errors
The server raises an exception as follows.
if view.serverHost != config.thisServer:
## We can't remove web views unless we're local,
since they don't
## have a global path.
log.msg("Web view '%s' cannot be removed because
it isn't on this server." % tag)
The server displays the following to the log.
2004/11/10 15:54 Eastern Standard Time [Broker,0,10.113.53.10] User
justin logged in
2004/11/10 15:54 Eastern Standard Time [Broker,0,10.113.53.10]
2004/11/10 15:54 Eastern Standard Time [-] Web view 'testview1' cann
ot be removed because it isn't on this server.
2004/11/10 15:54 Eastern Standard Time [-] Peer will receive following
2004/11/10 15:54 Eastern Standard Time [-] Failure: None: None
The failure that the client gets is None.
Does anyone know what I'm doing wrong here? I've searched through the
docs but don't see specific examples of how to use CopyableFailure, so
I made the assumption that I could raise a CopyableFailure instead of
specifically writing code to send the failure back to the client. Any
help is appreciated.
More information about the Twisted-Python