[Twisted-Python] Re: More on PB Copyable Errors

Justin Johnson justinjohnson at gmail.com
Tue Dec 28 15:34:02 EST 2004


Whoops... forgot the attachments.  Here they are.


On Tue, 28 Dec 2004 14:32:04 -0600, Justin Johnson
<justinjohnson at gmail.com> wrote:
> I would really like to be able to pass custom exceptions over the wire
> in PB.  Previous discussion on this list ended with the conclusion
> that it currently isn't possible without hacking a local copy of
> Twisted.
> 
> I have done that to get the result I want, with minimal testing, and
> would like to get some discussion going around this topic.  Attached
> are 3 test files, s.py for the server, c.py for the client, and e.py
> for the error definitions which are imported by both s.py and c.py.
> If I make the following modification to my local copy of
> twisted/spread/pb.py in the CopyableFailure's getStateToCopy method,
> the custom error is passed back as I want.
> 
>   #state['value'] = str(self.value) # Exception instance
>   state['value'] = self.value # Exception instance
> 
> I was wondering if there is a reason we wouldn't want to change the
> code to check for registered unjellyables for the exception, and
> return them (or rather go through the jelly/unjelly process) if they
> exist, but return the string representation otherwise.  Maybe that is
> more complicated than I realize.
> 
> Any thoughts or suggestions on how we might make this possible?
> Thanks.
> -Justin
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: c.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20041228/c55d85d8/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: e.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20041228/c55d85d8/attachment-0001.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: s.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20041228/c55d85d8/attachment-0002.txt 


More information about the Twisted-Python mailing list