[Twisted-Python] Transforming Exception -> pb.Error in a remote_foo method

Jean-Paul Calderone exarkun at divmod.com
Wed Dec 20 12:35:42 EST 2006


On Wed, 20 Dec 2006 10:17:04 -0700, Brian Granger <ellisonbg.net at gmail.com> wrote:
>Hi,
>
>In the Twisted docs it is claimed that in order to propagate exceptions over 
>PB:
>
>"The only special thing you do is to define your Exception subclass by
>deriving it from pb.Error. "
>
>This seems simple enough, but I am using PB to adapt a general service
>that doesn't use pb.Errors (as the service is also adapted to other
>protocols).  How can one transform a regular Exception to a pb.Error?
>The following does not work:
>

This is a bug in PB's handling of Deferreds which fail with an Error.
They are not handled in the same way as Errors which are raised
synchronously by the method to which the PB message is dispatched.

Could you file a ticket in the tracker?

Jean-Paul




More information about the Twisted-Python mailing list